Skip to content

Fix silent state loading failure in Phoenix menu#786

Merged
EdwardMoyse merged 1 commit into
HSF:mainfrom
remo-lab:fix/webgl-memory-leak-cleanup
Jan 24, 2026
Merged

Fix silent state loading failure in Phoenix menu#786
EdwardMoyse merged 1 commit into
HSF:mainfrom
remo-lab:fix/webgl-memory-leak-cleanup

Conversation

@remo-lab
Copy link
Copy Markdown
Contributor

Background

  • While debugging state restoration, I noticed loadStateFromJSON exits early if it encounters a config that no longer exists.
  • By that point, the parent node toggle is already applied.
  • Everything after that — remaining configs and all child nodes — is skipped entirely.

Why this matters

  • Phoenix configs change over time (renames, removals, refactors).

  • Users often load state files saved on older versions.

  • A single missing config breaks restoration for the entire subtree.

  • The UI ends up in a misleading state:

    • Parent appears enabled
    • Child nodes remain at defaults
  • The failure is silent apart from a console error, so users usually don’t know anything went wrong.


Fix

  • Replace the early return with a continue.

  • Skip only the missing config instead of aborting the entire restore.

  • Always continue restoring:

    • Remaining configs
    • All child nodes recursively
  • Missing entries now log warnings instead of stopping execution.


Outcome

  • State loading is resilient to version differences and modified state files.
  • Older and shared state files load as completely as possible.
  • Silent partial restores are eliminated.
  • Save/load behavior is now consistent and predictable.

Add cleanup methods to EffectsManager and SelectionManager to properly
release WebGL resources and remove event listeners during view transitions.

Signed-off-by: remo-lab <remopanda7@gmail.com>
@remo-lab
Copy link
Copy Markdown
Contributor Author

Hey @EdwardMoyse ! This PR fixes an early-exit issue in state restoration that could silently skip child nodes when a saved config no longer exists. The change is small but makes state loading much more resilient across versions. Would appreciate a review when you get a chance — thanks!

@EdwardMoyse EdwardMoyse merged commit 5c97cb0 into HSF:main Jan 24, 2026
2 checks passed
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.

2 participants