fix: Let calling message update the event timestamp when before a deleted message #14838
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
STR:
-> the last text message doesn't show up
The problem
The problem is that the conversation timestamp gets updated backward when deleting the last event of the conversation.
But because call events are not supposed to affect the timestamp, in this case we try to update the timestamp to the timestamp of a message that is not supposed to update it.
That means that the conversation last event timestamp will be in the future compared to the last loaded event (which typically means that the conversation is scrolled up and we are not looking at the last message of the conversation).
In this case the webapp doesn't append new messages at the end of the message list.
Notes for the future
This timestamp computation is pretty messy and would need a clean rethink at some point