fix(app): recover from malformed session diffs#21127
Open
jeanibarz wants to merge 4 commits intoanomalyco:devfrom
Open
fix(app): recover from malformed session diffs#21127jeanibarz wants to merge 4 commits intoanomalyco:devfrom
jeanibarz wants to merge 4 commits intoanomalyco:devfrom
Conversation
Author
|
Friendly ping — this is a small bug fix (guards against malformed |
c77bc4c to
9ca0687
Compare
9ca0687 to
78cdbb8
Compare
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 #21100
Type of change
What does this PR do?
The app currently assumes
session_diffis either missing or a valid diff array. If malformed cached or event payloads get into that slot, session review paths can treat the state as loaded and eventually call array methods on invalid values.This change keeps the fix narrowly scoped to that bug path:
session_diffpayloads before they are treated as loadedundefinedso review can refetch instead of freezing on bad stateHow did you verify your code works?
cd packages/app && PATH=/tmp/bun-1.3.11/bin:$PATH bun test --preload ./happydom.ts src/context/sync-session-diff.test.ts src/context/global-sync/session-diff.test.ts src/context/global-sync/event-reducer.test.ts src/pages/session/review-diff-state.test.tscd packages/app && PATH=/tmp/bun-1.3.11/bin:$PATH bun typecheckcd packages/app && PATH=/tmp/bun-1.3.11/bin:$PATH bun run test:unitScreenshots / recordings
N/A
Checklist