3 Commits

Author SHA1 Message Date
yepyhun
f986774b87 fix(chat): durably replace uncertain submissions and isolate recovery owners 2026-10-13 12:07:47 +02:00
szzhoujiarui
525a171e10 fix(web): resolve optimistic edit refresh race (#753)
Co-authored-by: szzhoujiarui <311234381+szzhoujiarui@users.noreply.github.com>
2026-08-06 19:19:45 +08:00
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