• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

icerpc / icerpc-csharp / 32426842747
86%

Build:
DEFAULT BRANCH: main
Ran 20 Aug 2026 11:04PM UTC
Jobs 1
Files 257
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Aug 2026 11:01PM UTC coverage: 87.975% (-0.05%) from 88.025%
32426842747

push

github

web-flow
Consume the MoveNextAsync ValueTask only once (#4845)

Fixes #4795.

In the stream-flush-threshold branch of `AsyncEnumerablePipeReader`, the
`ValueTask<bool>` returned by `MoveNextAsync` was consumed twice: first
by reading `moveNext.Result`, then by calling `moveNext.AsTask()`. A
`ValueTask` may only be consumed once — awaiting it, reading `Result` or
calling `AsTask()` are all consumptions — so this is plain incorrect,
even though it is never hit in practice today:

- When the `ValueTask` wraps a result directly or wraps a `Task`, both
consumptions are harmless reads.
- When it wraps an `IValueTaskSource<bool>`, the second consumption uses
a token that the first one may have invalidated. A pooled source that
resets itself in `GetResult` — the documented pattern for reusing a
source — makes `AsTask()` throw `InvalidOperationException`.

Compiler-generated `async IAsyncEnumerable<T>` iterators fall in the
benign category: their value task source is reset at the beginning of
the next `MoveNextAsync`, not in `GetResult`, so the token is still
valid for the second consumption. That is why no enumerator used in
practice fails today.

In this branch `hasNext` is known to be `true`, so the fix is to produce
the task from that value instead of consuming the `ValueTask` again. The
resulting `Task<bool>` is the same. The Protobuf copy of this code gets
the same fix.

## What's Changed entry

None — no supported enumerator implementation is affected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

2 of 2 new or added lines in 2 files covered. (100.0%)

30 existing lines in 3 files now uncovered.

12349 of 14037 relevant lines covered (87.97%)

3012.74 hits per line

Coverage Regressions

Lines Coverage ∆ File
14
79.61
-13.59% src/IceRpc/Internal/PipeReaderExtensions.cs
13
89.71
-0.36% src/IceRpc/Transports/Slic/Internal/SlicConnection.cs
3
89.7
0.0% src/IceRpc/Internal/IceProtocolConnection.cs
Jobs
ID Job ID Ran Files Coverage
1 32426842747.1 20 Aug 2026 11:04PM UTC 3841
15.59
GitHub Action Run
Source Files on build 32426842747
  • Tree
  • List 257
  • Changed 206
  • Source Changed 2
  • Coverage Changed 206
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32426842747
  • b7889101 on github
  • Prev Build on main (#32421583217)
  • Next Build on main (#32426888081)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc