Skip to content

fix(worker): ignore Canceled unhandled rejections - #9

Open
kazablock wants to merge 1 commit into
pithings:mainfrom
kazablock:fix/worker-canceled-rejection
Open

kazablock wants to merge 1 commit into
pithings:mainfrom
kazablock:fix/worker-canceled-rejection

Conversation

@kazablock

Copy link
Copy Markdown

VS Code promise-cancellation races surface as Canceled rejections (e.g. a pending ptyHost resolved-variables RPC cancelled on extension-host restart). Treating them as fatal crashed the worker on every restart, and the respawn loop re-triggered the same race. Canceled rejections (by name or message) are now logged and ignored; all others still forward { type: error } to the parent and exit 1, so the respawn contract is unchanged.

Adds lib/worker.test.ts: forks the actual worker.mjs against a stubbed dist entry in a temp dir and covers both Canceled shapes plus the forward-and-exit path end-to-end over IPC.

VS Code promise-cancellation races surface as Canceled rejections (e.g. a
pending ptyHost resolved-variables RPC cancelled on extension-host restart).
Treating them as fatal crashed the worker on every restart, and the respawn
loop re-triggered the same race. Canceled rejections (by name or message) are
now logged and ignored; all others still forward { type: error } to the
parent and exit 1, so the respawn contract is unchanged.

Adds lib/worker.test.ts: forks the actual worker.mjs against a stubbed dist
entry in a temp dir and covers both Canceled shapes plus the forward-and-exit
path end-to-end over IPC.
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