Files
DeepTutor/web/lib
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-06-17 10:50:44 +08:00
2026-07-19 16:56:34 +08:00
2026-07-24 03:06:58 +08:00
2026-04-23 19:29:16 +08:00
2026-05-02 20:16:07 +08:00
2026-05-01 13:51:45 +08:00
2026-07-24 03:06:58 +08:00
2026-06-13 21:10:57 +08:00
2026-05-01 01:39:08 +08:00
2026-01-23 01:42:25 +08:00
2026-01-07 10:53:01 +08:00
2026-07-19 16:56:34 +08:00
2026-03-13 01:47:38 +08:00
2026-06-17 00:56:27 +08:00
2026-07-09 23:23:27 +08:00
2026-06-11 20:03:34 +08:00
2026-06-11 20:03:34 +08:00
2026-06-17 00:56:27 +08:00
2026-04-30 23:41:58 +08:00
2026-06-18 00:22:48 +08:00
2026-06-18 00:22:48 +08:00
2026-06-11 20:03:34 +08:00
2026-04-23 19:29:16 +08:00
2026-06-27 18:27:16 +08:00
2026-04-23 19:29:16 +08:00
2026-05-03 16:35:52 +08:00
2026-06-18 00:22:48 +08:00
2026-06-17 00:56:27 +08:00
2026-06-11 20:03:34 +08:00
2026-04-23 19:29:16 +08:00
2026-06-11 20:03:34 +08:00
2026-07-24 18:16:04 +08:00
2026-06-11 20:03:34 +08:00
2026-05-12 02:20:30 +08:00