famedly / matrix-dart-sdk

Matrix SDK written in pure Dart.
GNU Affero General Public License v3.0
49 stars 31 forks source link

fix: only set lastEvent when successfully sent #1852

Open td-famedly opened 1 month ago

td-famedly commented 1 month ago

Fixes: https://github.com/famedly/product-management/issues/1684

td-famedly commented 4 weeks ago

Not sure. Currently in FluffyChat I display the current sending event in the chat list with a loading indicator which makes it clear that in this room I currently try to send a message. This would be lost after merging this.

otoh I have checked telegram ~and whatsapp~, both seem to only set the last even in chats list once sending was successful. My initial changes just reverted the lastEvent to the next possible lastEvent in the room timeline, but the team suggested just not to set the last event until sent which is much simpler.

krille-chan commented 4 weeks ago

otoh I have checked telegram and whatsapp, both seem to only set the last even in chats list once sending was successful.

I can reproduce on WhatsApp (iOS) that the message is already set as last event even when it is not sent yet. Sent a message in airplane mode and can see it in the chat list. Deleting it changes the last event to "You have deleted this message".

td-famedly commented 4 weeks ago

otoh I have checked telegram and whatsapp, both seem to only set the last even in chats list once sending was successful.

I can reproduce on WhatsApp (iOS) that the message is already set as last event even when it is not sent yet. Sent a message in airplane mode and can see it in the chat list. Deleting it changes the last event to "You have deleted this message".

I tried to send a huge file, closed and opened the app which caused sending to fail. Then deleted the errored file send, the last event then was the previous event, not "You have deleted this message".

Telegram on the other hand does this for every message, possibly due to lack of chat list last event in sending state preview feature.