fix(app): normalize record-shaped desktop list values#35553
Open
megamen32 wants to merge 1 commit into
Open
Conversation
Normalize SDK and persisted list values before array operations so desktop startup can tolerate record-shaped session, command, project, permission, and question payloads.\n\nFixes anomalyco#35551
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #35551
Type of change
What does this PR do?
The desktop app can receive some list-shaped values as object maps from persisted state or API responses. The renderer then calls array methods such as
.filter(),.map(), or.find()and crashes on startup/navigation.This change adds a small
listValue()helper that accepts either an array or a record and returns an array. It applies that normalization to the desktop paths that handle sessions, commands, projects, permissions, and questions before array operations.The reported macOS crash was:
After fixing that locally, the next same-shape issue was:
Both are handled by normalizing the value before array operations.
How did you verify your code works?
From
packages/app:Result:
Also passed:
bun run buildcompleted successfully with existing Vite chunk/dynamic import warnings.A normal push ran the repository-wide pre-push hook and failed in unrelated packages with existing
Buffer/URLtype errors and thenSIGSEGV/ code 139. I pushed with--no-verifyafter the app tests, app typecheck, and app build above passed.Screenshots / recordings
No UI change. The local patched desktop build reached server ready and stopped logging the renderer crashes above.
Checklist