Skip to content

fix: unsubscribe constant layout on disposal - #285

Open
dajiaohuang wants to merge 1 commit into
anvaka:masterfrom
dajiaohuang:fix-constant-layout-dispose-w17-20261025
Open

dajiaohuang wants to merge 1 commit into
anvaka:masterfrom
dajiaohuang:fix-constant-layout-dispose-w17-20261025

Conversation

@dajiaohuang

Copy link
Copy Markdown

The constant layout subscribes to the graph's changed event but dispose() removes a listener for change. Consequently, a disposed layout remains subscribed and continues processing graph mutations.

Use the same changed event name when unsubscribing. The source and both tracked browser distributions contain the same one-word correction. Distribution edits are narrowly applied to the existing assets to avoid unrelated rebuild/line-ending changes.

Added native TAP regressions through source and the distribution: active updates work; disposing twice is harmless; later additions/removals do not mutate disposed layout state; another active layout still receives changes. On the original code, four of these assertions fail (74/78 pass); note that invoking this old TAP test file directly still exits 0 despite failed assertions.

Validation on Node24.14.1: npm run build passes, and npm test passes 726/726. After narrowing the generated asset changes, npm test again passes 726/726 and git diff --check passes. CI Node18/20 matrix and browser/WebGL interaction were not run locally. All graph data is synthetic; no real graphs, private assets or services were used.

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