Skip to content

Fix update of bytes read in the encoder state machine.#456

Merged
robjtede merged 1 commit intoNullus157:mainfrom
orium:fix-flush-encoder
Feb 18, 2026
Merged

Fix update of bytes read in the encoder state machine.#456
robjtede merged 1 commit intoNullus157:mainfrom
orium:fix-flush-encoder

Conversation

@orium
Copy link
Contributor

@orium orium commented Feb 11, 2026

Previously we were not updating the number of bytes read: we were just changing the local binding of read. This means that read was always zero and therefore the encoder never flushed.

Fixes #455

@orium orium force-pushed the fix-flush-encoder branch from 494f082 to 5996a6f Compare February 11, 2026 16:12
@orium
Copy link
Contributor Author

orium commented Feb 11, 2026

I'll try to add a test for this. Right now I'm investigating the failing tests.

@orium
Copy link
Contributor Author

orium commented Feb 11, 2026

I'll try to add a test for this. Right now I'm investigating the failing tests.

This seems to be another bug introduced in 8947fed. I've reverted that commit in this PR (first commit). I think the bug is that we were turning some Poll::Pending into Poll::Ready(Ok(0)) signaling an EOF when there's actually more data to read.

@orium orium changed the title Fix update of bytes read in the encoder state machine. [WIP!] Fix update of bytes read in the encoder state machine. Feb 11, 2026
@orium orium changed the title [WIP!] Fix update of bytes read in the encoder state machine. [WIP] Fix update of bytes read in the encoder state machine. Feb 11, 2026
@orium orium marked this pull request as draft February 11, 2026 18:02
@orium orium changed the title [WIP] Fix update of bytes read in the encoder state machine. Fix update of bytes read in the encoder state machine. Feb 11, 2026
@orium orium force-pushed the fix-flush-encoder branch from 4ed8167 to 2954200 Compare February 12, 2026 16:02
@orium orium marked this pull request as ready for review February 12, 2026 16:06
@orium
Copy link
Contributor Author

orium commented Feb 12, 2026

@NobodyXu This should be ready for review now.

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks the encoder the change look good to me, but the decoder change really got me confused on what exactly is changed (its behavior is identical before and after this PR) and not related to this PR, can we have the decoder change reverted please?

@orium orium force-pushed the fix-flush-encoder branch from 2954200 to f87860a Compare February 13, 2026 10:20
Previously we were not updating the number of bytes read: we were just changing
the local binding of `read`. This means that read was always zero and therefore
the encoder never flushed.

Fixes Nullus157#455.
@orium orium force-pushed the fix-flush-encoder branch from f87860a to a093589 Compare February 13, 2026 16:09
Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM

I will ask @robjtede to also review just in case I'd make a mistake somewhere

@orium
Copy link
Contributor Author

orium commented Feb 18, 2026

@robjtede Hi. Can you take a look to unblock the PR from landing?

Copy link
Member

@robjtede robjtede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, that's a subtle bug

@robjtede robjtede added this pull request to the merge queue Feb 18, 2026
Merged via the queue into Nullus157:main with commit 9df508b Feb 18, 2026
23 checks passed
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (0370b47) to head (a093589).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #456   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot mentioned this pull request Feb 10, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 18, 2026
## 🤖 New release

* `compression-codecs`: 0.4.36 -> 0.4.37 (✓ API compatible changes)
* `async-compression`: 0.4.39 -> 0.4.40 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `compression-codecs`

<blockquote>

##
[0.4.37](compression-codecs-v0.4.36...compression-codecs-v0.4.37)
- 2026-02-18

### Other

- Stop consuming input on errors in codecs.
([#451](#451))
</blockquote>

## `async-compression`

<blockquote>


##
[0.4.40](async-compression-v0.4.39...async-compression-v0.4.40)
- 2026-02-18

### Other

- Fix update of bytes read in the encoder state machine.
([#456](#456))
- *(deps)* update rand requirement from 0.9 to 0.10
([#449](#449))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The encoder is never flushing

3 participants