Skip to content

wasm: don't panic when removing an already-removed overlay - #335

Merged
PolyMeilex merged 1 commit into
PolyMeilex:masterfrom
rogerwq:fix/wasm-cancel-panic
Sep 26, 2026
Merged

PolyMeilex merged 1 commit into
PolyMeilex:masterfrom
rogerwq:fix/wasm-cancel-panic

Conversation

@rogerwq

@rogerwq rogerwq commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #334.

The cancel closure in WasmDialog::show is registered as both the cancel button's onclick and the input's native cancel listener, and it's forgetten rather than dropped, so it can run twice for one dialog. The second remove_child call panics with NotFoundError, which is unrecoverable on wasm32-unknown-unknown and kills the whole instance.

As confirmed in the issue thread, this switches to the simplest fix: stop unwrapping the removal, since removing an already-gone node is the outcome the caller wants anyway.

🤖 Generated with Claude Code

WasmDialog's cancel closure is registered both as the cancel button's
onclick and the input's native `cancel` listener, and it is forgotten
rather than dropped after use, so it can run twice for a single dialog.
The second invocation's remove_child call panics on
NotFoundError, which is unrecoverable on wasm32-unknown-unknown and
kills the whole instance.

Removing a node that is already gone is exactly the outcome the caller
wants, so stop unwrapping the result.

Fixes PolyMeilex#334

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@PolyMeilex PolyMeilex added the no changelog Ignore changelog CI check label Sep 26, 2026
@PolyMeilex
PolyMeilex merged commit 2a41631 into PolyMeilex:master Sep 26, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog Ignore changelog CI check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasm: cancelling a file dialog can panic on remove_child, killing the wasm instance

2 participants