omi icon indicating copy to clipboard operation
omi copied to clipboard

Conversations: merged rows stay on 'Merging…' until the app restarts when the push doesn't reach the running app

Open Itaxh1 opened this issue 2 months ago • 1 comments

Product impact

  • Primary loop layer: Memory
  • [x] Involves data loss, failed capture, or broken sync/trust

Describe the bug

After a merge, the involved rows stay on "Merging…" until the merge_completed push reaches the running app. The local mergingConversationIds set is cleared only by onMergeCompleted, which listens to MergeNotificationHandler.onMergeCompleted, and by clearUserData (sign-out). Pull to refresh does not clear it.

When the push never reaches the UI isolate, the rows stay stuck: while merging they cannot be selected, long-pressed or swiped, and the merged result doesn't appear, until the app is restarted. That happens when notifications are off, when a push is lost, and when the push arrives while the app is in the background. The background FCM handler runs in its own isolate, so its broadcast has no listener in the app's isolate.

To reproduce

  1. Select two conversations → Merge.
  2. Either switch notifications off first, or send the app to the background until the merge finishes.
  3. Return to Conversations and pull to refresh.

Current behavior

The rows keep the pulsing "Merging…" state and stay locked until the app restarts.

Expected behavior

The rows settle once the server finishes the merge, with or without the push: the survivor replaces them and the removed ones disappear.

Evidence

Suggested fix

After starting a merge, also poll the involved conversations until none is merging (bounded), then apply the same result as the push, or hand the rows back to a list refresh.

Fix available

Fixed with tests on the fork branch design/v2-step0-tokens (043db6c3cc, conversation_provider_merge_watch_test.dart, 5 cases). 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

Submitted fix in PR #21417 with comprehensive unit tests for merge settling without push delivery.

Dragonire9 avatar Oct 13 '26 16:10 Dragonire9