Repository navigation
fix(dio): release response streams when consumers cancel - #2617
Draft
kaluli123123 wants to merge 1 commit into
Draft
kaluli123123 wants to merge 1 commit into
kaluli123123 wants to merge 1 commit into
Conversation
Propagate consumer cancellation to the source response subscription, stop receive-timeout work, and wait for asynchronous source cleanup. Keep normal completion and late CancelToken cleanup idempotent. Closes cfug#2616 Co-authored-by: Codex <noreply@openai.com>
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.
Consumer cancellation of a
ResponseType.streamresponse now cancels the adapter-response subscription, stops receive-timeout work, and awaits asynchronous source cleanup. Normal completion and a later CancelToken do not close the adapter response again.Closes #2618.
The formal Bug report was created using the repository's actual template name (
🐞 Bug Report) through GraphQLCreateIssueInput.issueTemplate. Itss: bugandh: need triagelabels were retained at creation; it remains open and unlocked, and the issue-access workflow was skipped as intended. Earlier reports #2615 and #2616 remain closed and locked as template-admission history. This does not assert maintainer acceptance of the defect; normal triage and review remain pending.Added six regressions through the public Dio API, covering
.first, direct and paused cancellation, asynchronous cleanup, and late tokens after normal completion/error. The original four cancellation regressions fail without the fix; the response suite now passes 16 tests on VM and Chrome. Full Chrome checks passed 238 tests with 1 skip, Wasm checks passed 240 with 1 skip, and the native adapter's Flutter test runner passed 29. All ten packages passed analysis and formatting. Independent read-only review found no blocking issues.Unverified/environment limits: Full VM checks report 382 passed, 10 skipped and 5 failed; the same five invalid-domain/DNS-network failures were reproduced on an independent unchanged-main worktree. They occur before this response-stream handler. Firefox, minimum-SDK testing, Android/iOS device integration, and upstream CI have not been verified. No failing expectations were changed and no lints or tests were disabled.
@cfug/dio-core This changes cancellation/timeout resource cleanup, so it merits the additional scrutiny described in the agent guidelines. Public APIs, adapters' signatures, and exception types are unchanged.
Implementation, regression tests and independent read-only review used Codex; the commit includes
Co-authored-by: Codex <noreply@openai.com>. The GitHub-verified signed delivery tree is identical to locally testedae533cc1f8. This draft remains pending the contributor's review and maintainer acceptance.New Pull Request Checklist
main.dio/CHANGELOG.mdunder Unreleased.