Repository navigation
Allow Flush as no-op on read-only streams - #919
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix read-only streams to allow no-op flush
Allow Flush as no-op on read-only streams
Feb 9, 2026
Changed SubstreamReader, NestedStream, and ReadOnlySequenceStream to allow Flush/FlushAsync as no-ops instead of throwing NotSupportedException. Updated corresponding tests. Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
AArnott
force-pushed
the
copilot/fix-read-only-stream-flush
branch
from
February 9, 2026 03:41
17caf51 to
1ab45e0
Compare
AArnott
marked this pull request as ready for review
February 9, 2026 03:41
AArnott
enabled auto-merge
February 9, 2026 03:41
This was referenced Sep 14, 2026
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Read-only streams (
SubstreamReader,NestedStream,ReadOnlySequenceStream) were throwingNotSupportedExceptionon Flush operations. Per dotnet/runtime#105592 and #110899, they should allow Flush as a no-op.Changes
Flush()andFlushAsync()to check disposal state and return immediately instead of throwingNotSupportedExceptionObjectDisposedExceptionwhen disposedExample
Before:
After:
Implementation uses
Task.CompletedTask(.NET 5+) orTask.FromResult(0)for async variants.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.