You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chat: a message sent while the history is still loading disappears, and the reply overwrites a row #19232
Involves data loss, failed capture, or broken sync/trust
Describe the bug
Opening chat starts the history load ("Reading your memories…"). A message sent before that load returns is
dropped from the screen: the load replaces messages wholesale, and the streamed reply is then written to an
index computed before the replacement.
To reproduce
New account (no cached messages), open chat.
While "Reading your memories…" is showing, type a message and send.
Wait for the reply.
Current behavior
The user's own message disappears and only Omi's reply is left (seen on device with a new account). Depending on
what the load returned, the reply lands on another row's index, or messages[aiIndex] is out of range.
Expected behavior
The sent message and its reply both stay, in order, whether or not the history load lands in between.
Evidence
lib/providers/message_provider.dart:512 — getMessagesFromServer assigns messages = List.from(mes),
discarding anything added since the load began (the human message and the reply placeholder).
Merge the loaded history with messages created after the load started (skip a human message the server already
returned), and replace the reply placeholder by identity instead of by index.
Activity