Repository navigation
fix: keep late WebSocket errors scoped to their task - #13
Open
agocharbhatia wants to merge 1 commit into
Open
agocharbhatia wants to merge 1 commit into
agocharbhatia wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include
|
This branch has not been deployed
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.
Problem
After a call is cancelled or times out, its server-side task may still finish. If a late WebSocket error names that task after its subscription has been removed, the current fallback broadcasts it to every remaining subscriber. An unrelated active call can therefore fail with the cancelled task's error.
Mixed frames also broadcast task-specific errors alongside unscoped errors. The public error contract scopes a taskUUID to its failed request, while the SDK cancellation contract explicitly leaves server-side processing running.
Change
Keep errors owned by their task. Deliver matched task errors to that subscription, log and ignore unmatched task errors, and broadcast only errors without a taskUUID. Existing success routing, authentication, resend/conflict handling, callback isolation and reconnect behavior are preserved. No public API or dependency change.
Validation
65979e46279a71174171fc8ec4d0a3b12df46180and pass with this patch. They cover cancellation, timeout, singular/plural envelopes and mixed scoped/unscoped errors.Wider-suite limitation
An initial wider run passed 405 tests with 13 skipped before type-only/format cleanup of the new test file; runtime code was identical. Two subsequent clean frozen replays were not green: one had an existing REST timing assertion fail (404 passed, 13 skipped), and the other had two existing reconnect tests fail (403 passed, 13 skipped). Their causes are not established. The isolated REST timing group and independent focused routing/lifecycle run pass, but these do not erase those failures or establish consistent full-suite success.
All protocol traffic was local and mocked, using actual SDK code. No API key, live inference, production incidence, performance benchmark, browser-runtime or cross-runtime claim. Live integration tests remain skipped; separately supplied cross-SDK fixtures were unavailable. If the service uses an undocumented post-authentication global error sentinel with a taskUUID, a concrete fixture would help validate that contract rather than guessing a special value.