element-x-ios icon indicating copy to clipboard operation
element-x-ios copied to clipboard

Message sent got completely lost.

Open ara4n opened this issue 1 year ago • 4 comments

Steps to reproduce

  1. I wrote a msg in HQ, and hit send, and rapidly went to the room list
  2. later on, went back, and the msg had vanished
  3. checked on another client; it was never sent.

Outcome

What did you expect?

Never lose msgs.

Your phone model

No response

Operating system version

No response

Application version

778

Homeserver

No response

Will you send logs?

Yes

ara4n avatar Dec 03 '24 17:12 ara4n

See also https://github.com/element-hq/element-x-ios/issues/3006 (possibly, although i don't think this was a clean launch)

ara4n avatar Dec 03 '24 17:12 ara4n

There might be a relation with https://github.com/element-hq/element-x-ios/issues/3186 too. The scenario to reach the issue is quite similar. The consequense is worse here.

manuroe avatar Dec 04 '24 08:12 manuroe

i just had another of these (this time e2ee room)

ara4n avatar Jan 04 '25 01:01 ara4n

got this again on build 859. the room in question was e2ee and very busy at the time. have rageshaked

ara4n avatar Mar 08 '25 13:03 ara4n

@kegsay's seeing it too on EXA (see rageshakes).

ara4n avatar Apr 28 '25 17:04 ara4n

just got it again - see rageshake :|

ara4n avatar May 09 '25 09:05 ara4n

The two last rageshakes exhibit a bad case of sqlite's database is locked error while trying to push the message in the send queue.

  • We're always enabling WAL mode, and the fact it's happening in Android (mono-processed) shows it's not (always) caused by multiprocess access to the DB.
  • We've seen this error happen when a read transaction is promoted into a write transaction, in the past, but it's not the case here because the transaction only involves in a single insertion.

But sqlite's doc says the error can still happen under extraordinary circumstances and must be retried in those cases; this may be what's happening here, so we'll try setting up the busy_timeout so that an operation is automatically retried if it failed because the database was locked, after sleeping for a bit.

https://github.com/matrix-org/matrix-rust-sdk/pull/5025

bnjbvr avatar May 13 '25 10:05 bnjbvr