Repository navigation
fix: unsubscribe constant layout on disposal - #285
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.