Skip to content

fix(ui): guard session review diffs#33664

Open
lin-hongkuan wants to merge 1 commit into
anomalyco:devfrom
lin-hongkuan:web-diff-guard
Open

fix(ui): guard session review diffs#33664
lin-hongkuan wants to merge 1 commit into
anomalyco:devfrom
lin-hongkuan:web-diff-guard

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Issue for this PR

Closes #19268

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

SessionReview already had a local normalizer for diff-like payloads, but one path still called props.diffs.map(...) directly. If a stale or malformed session payload supplied summary.diffs as an object, null, or another non-array value, the review UI could crash before the normalizer helped.

This PR moves the review diff normalizer into a small pure module, uses it for both the diff map and file list, and widens the component prop to accept unknown runtime payloads defensively.

How did you verify your code works?

  • bun test src/components/session-review.test.ts from packages/ui
  • bun run typecheck from packages/ui
  • bun run typecheck from packages/app
  • git diff --check from the repo root

Screenshots / recordings

Not included; this is a defensive crash fix for malformed diff data.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

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.

Web mode crash when session diffs payload is non-array

1 participant