Repository navigation
fix(dio): release response streams when consumers cancel - #2617
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 <[email protected]>
|
Current-head CI evidence for These are expired workflow-approval gates, not executed test/analyzer failures. The empty PR check rollup is not CI success. A maintainer with workflow permissions needs to handle the approval/expired-run gates before upstream validation can complete. No source, workflow, or draft-status change was made, and local tests were not repeated in this metadata-only maintenance pass; the earlier local results remain distinct from upstream CI. |
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 <[email protected]>. 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.