Skip to content

fix(web-client): latch worker failures so later calls fail fast - #358

Open
kutluhaneth46 wants to merge 1 commit into
0xMiden:nextfrom
kutluhaneth46:fix/web-worker-failure-latch-315
Open

fix(web-client): latch worker failures so later calls fail fast#358
kutluhaneth46 wants to merge 1 commit into
0xMiden:nextfrom
kutluhaneth46:fix/web-worker-failure-latch-315

Conversation

@kutluhaneth46

Copy link
Copy Markdown

Summary

  • WebClient only listened for message, so a worker load/parse crash or uncaught worker error left ready and pendingRequests hanging forever.
  • Latch workerFailure, handle error / messageerror (preventDefault), flush in-flight requests, and reject later callMethodWithWorker calls immediately.
  • Extract the latch into workerFailure.js with unit tests (empty event.message vs load failure, idempotent second failure).

Fixes #315

Test plan

  • pnpm test:unit -- js/__tests__/workerFailure.test.js in crates/web-client
  • Confirm a subsequent callMethodWithWorker after latch rejects with the same error instead of hanging.

A dead worker only had a message listener, so load/runtime failures left ready and pendingRequests hanging. Latch workerFailure, handle error/messageerror, and reject subsequent callMethodWithWorker calls.

Fixes 0xMiden#315

Co-authored-by: Cursor <cursoragent@cursor.com>
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