omi icon indicating copy to clipboard operation
omi copied to clipboard

Chat: a message sent while the history is still loading disappears, and the reply overwrites a row

Open Itaxh1 opened this issue 2 months ago • 0 comments

Product impact

  • Primary loop layer: Retrieval-Action (chat)
  • [x] 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

  1. New account (no cached messages), open chat.
  2. While "Reading your memories…" is showing, type a message and send.
  3. 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

Suggested fix

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.

Fix available

Fixed with a regression test on the fork branch design/v2-step0-tokens (bc79f057cb). It will be linked from the draft PR.

Found while testing the Omi v2 Flutter restyle on an iPhone, then confirmed against main at 32c2ed22cf.

Itaxh1 avatar Sep 26 '26 17:09 Itaxh1