Messages sent while offline sometimes show up multiple times once the connection comes back. Recipients are getting the same message two or three times.
The offline experience is: you're disconnected, you type and send some messages, they queue up locally, and when you're back online they sync to the server. That part works. The problem is duplicates, a message you sent once offline can land two or three times for the people in the conversation.
It seems to get worse the more times the app reconnects. If it briefly connects, drops, and connects again a few times (moving between wifi and cellular, waking the phone, that sort of thing), the duplicates multiply. So it feels tied to the sync running more than once against the same queued message.
Reproduction that's worked for me:
- Go offline, send a message or two, stay offline.
- Come back online, then toggle connectivity a couple more times (or background and foreground the app repeatedly) to make it re-sync several times.
- Check what the recipient actually received.
Expected: a message sent once offline is delivered exactly once, regardless of how many times the app reconnects or retries the sync.
Actual: the same message gets delivered multiple times.
I suspect the queued message doesn't carry anything that lets the server recognize "I've already seen this one," so each sync attempt inserts it fresh, and there's maybe something about a partial failure making the app think a message still needs sending when it actually already went through. Not sure though.
Can someone look at how the offline queue flushes to the server on reconnect and make delivery exactly-once, so replaying the queue (or a half-completed sync) can't produce duplicates. A test that queues a message and then runs the sync more than once, expecting a single delivered copy, would cover it.
Messages sent while offline sometimes show up multiple times once the connection comes back. Recipients are getting the same message two or three times.
The offline experience is: you're disconnected, you type and send some messages, they queue up locally, and when you're back online they sync to the server. That part works. The problem is duplicates, a message you sent once offline can land two or three times for the people in the conversation.
It seems to get worse the more times the app reconnects. If it briefly connects, drops, and connects again a few times (moving between wifi and cellular, waking the phone, that sort of thing), the duplicates multiply. So it feels tied to the sync running more than once against the same queued message.
Reproduction that's worked for me:
Expected: a message sent once offline is delivered exactly once, regardless of how many times the app reconnects or retries the sync.
Actual: the same message gets delivered multiple times.
I suspect the queued message doesn't carry anything that lets the server recognize "I've already seen this one," so each sync attempt inserts it fresh, and there's maybe something about a partial failure making the app think a message still needs sending when it actually already went through. Not sure though.
Can someone look at how the offline queue flushes to the server on reconnect and make delivery exactly-once, so replaying the queue (or a half-completed sync) can't produce duplicates. A test that queues a message and then runs the sync more than once, expecting a single delivered copy, would cover it.