Files
DeepTutor/web
Bingxi Zhao (Frank) 2faaef9ee8 fix(chat): mint unique optimistic message ids (#698)
An optimistic row's id was `-Date.now()`, and ADD_USER_MSG / STREAM_START
are dispatched back-to-back — so the user row and the assistant placeholder
routinely landed in the same millisecond and shared one id.

`reconcileTurnIds` keys its optimistic->persisted remap by id, so the two
rows collapsed onto a single persisted id when the turn's `done` arrived.
The next turn then pinned `parent_message_id` to the previous USER message
(an orphan branch server-side) and `buildVisiblePath` dropped the assistant
reply until a session reload put the DB's ids back.

Invisible until v1.5.4: the post-turn full-session refetch that 308a0606
replaced with in-place reconciliation used to overwrite the collision.

Mint ids from one seam that never repeats itself instead — same negative,
time-ordered shape the sibling ranking relies on.
2026-07-26 20:46:36 +08:00
..
2026-01-23 01:42:25 +08:00
2026-06-17 00:56:27 +08:00
2025-12-28 23:45:41 +08:00
2025-12-28 23:45:41 +08:00
2026-01-23 01:42:25 +08:00
2026-05-08 02:36:24 +08:00
2026-06-11 20:03:34 +08:00
2026-06-11 20:03:34 +08:00
2025-12-28 23:45:41 +08:00
2026-06-27 18:27:16 +08:00
2026-01-15 02:49:17 +08:00