AstrBot-Desktop/src
YokiiroBW 828f7c586d fix(chat): accept null in runtime event contracts
Rust serializes `Option<String>` without `skip_serializing_if`, so absent
fields arrive as `null`. Zod's `.optional()` accepts only `undefined`, so
`safeParse` failed and three chains silently died:

- `boundRuntimeEventSchema.sessionId/messageId`: desktop-v1 and mock events
  carry no session id, so every one of them was discarded; AstrBot error and
  heartbeat frames were discarded too.
- `remoteChatSessionSchema.displayName/updatedAt`: one null field threw for
  the whole array, leaving the remote session list permanently empty.
- `astrbotModelOptionSchema.name`: a null name failed capability parsing,
  which permanently disabled the file upload button.

The sibling `slotRuntimeSnapshotSchema` in the same file already used
`.nullish()` throughout, which is what makes this look like a miss during the
de-enveloping change rather than a deliberate choice.

`formatSessionTime` widens with it: `updatedAt` is now `string | null` and the
existing falsy guard already handled null.

Refs P1-7a / F-06.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 22:31:44 +08:00
..
features fix(chat): accept null in runtime event contracts 2026-07-26 22:31:44 +08:00
lib refactor(ui): share ipc error formatting 2026-07-26 22:31:16 +08:00
pages refactor(ui): share ipc error formatting 2026-07-26 22:31:16 +08:00
test feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
types feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
App.test.tsx refactor(ui): complete desktop frontend redesign 2026-07-22 00:27:06 +08:00
App.tsx refactor(ui): share ipc error formatting 2026-07-26 22:31:16 +08:00
main.tsx feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
styles.css chore(roadmap): sync roadmap status and acceptance gate 2026-07-22 03:09:35 +08:00
vite-env.d.ts feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00