Fix layout import missing content due to SourceList crash#471
Open
jmpatri615 wants to merge 2 commits into
Open
Fix layout import missing content due to SourceList crash#471jmpatri615 wants to merge 2 commits into
jmpatri615 wants to merge 2 commits into
Conversation
When hub windows are closed, they are not removed from the hubWindows array. This causes stale references to destroyed windows to accumulate over time, particularly during layout import where all existing windows are closed and replaced. While most iteration sites guard with isDestroyed() checks and sendMessage catches exceptions, the stale entries still cause unnecessary iteration and represent a memory leak. Add a "closed" event handler on each hub window to properly remove it from the hubWindows array when it is closed.
SourceList.updateItem crashes with "Cannot read properties of undefined (reading 'startsWith')" when a source list type config references an option key for its color (e.g. "bumpers") but the item's options dictionary does not contain that key. This happens during layout import because source list items are restored before the data source populates option values, causing the entire setState forEach to abort mid-way through. As a result, remaining source list items and all subsequent tabs fail to restore, leading to missing content in the imported layout. Add a safe lookup for option-based colors so that a missing key falls through to the default color instead of crashing.
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.
Test plan