Skip to content

fix: keep late WebSocket errors scoped to their task - #13

Open
agocharbhatia wants to merge 1 commit into
Runware:mainfrom
agocharbhatia:fix/isolate-late-task-errors
Open

agocharbhatia wants to merge 1 commit into
Runware:mainfrom
agocharbhatia:fix/isolate-late-task-errors

Conversation

@agocharbhatia

Copy link
Copy Markdown

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

  • The same six actual-client/transport regressions fail on unchanged base 65979e46279a71174171fc8ec4d0a3b12df46180 and pass with this patch. They cover cancellation, timeout, singular/plural envelopes and mixed scoped/unscoped errors.
  • Independent archive replay reproduces the same before/after result. Focused WebSocket routing/lifecycle coverage reports 42 passing cases and zero failures, including the reconnect cases noted below.
  • Lint, typecheck and build pass locally; lint and typecheck were independently rerun.

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.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include coderabbit-review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96208756-ca95-4bf5-94f5-4afd9b6b3cc9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant