Repository navigation
Commit 1cb5f9f
committed
fix(web): make diffs optional in UserMessage summary to prevent TypeError
The web UI was crashing with 'TypeError: e.diffs.map is not a function' when
accessing sessions without diffs data. This was caused by:
1. The backend Zod schema marking diffs as required in UserMessage.summary
2. The frontend calling .map() on potentially undefined diffs
Changes:
- Make diffs optional in message-v2.ts User schema (adds .optional())
- Regenerate TypeScript SDK to reflect the optional type
- Add defensive null-coalescing (props.diffs ?? []) in session-review.tsx
Fixes anomalyco#192701 parent 41c77cc commit 1cb5f9f
3 files changed
Lines changed: 4 additions & 4 deletions
File tree
- packages
- opencode/src/session
- sdk/js/src/v2/gen
- ui/src/components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
0 commit comments