fix(chat): guard localLastReadMessage against implausible message ids - #6486
Conversation
532280b to
7e184f6
Compare
rapterjet2004
left a comment
There was a problem hiding this comment.
It remains important to make sure that the conversation model is synchronized with the server. We don't want to end up missing notification messages because the conversation?.lastMessage is out of date.
Sure. As far as i see an outdated lastMessage would not be a problem regarding the notifications. It's just about gating unrealistic high messageIds (that could be caused by bugs) from becoming the lastReadMessage on server |
Prevents unplausible high message ids from being sent to the server as the read marker, which was marking conversations read far beyond their real last message and causing new chat notifications to be immediately deleted. Assisted-by: Claude Code 2.1.199:claude-sonnet-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
7e184f6 to
f068094
Compare
I increased PLAUSIBLE_MESSAGE_ID_BUFFER to 10000 just to be super sure that the gate does not block when lastReadMessage is valid. Imagine a very big instance with a lot of activity: All chats bump the messageId as it's not tied to conversations. I think 10000 must be high enough as buffer and it still guards most weird unrealistic id's. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/31689094233/artifacts/9176906697 |
Prevents unplausible high message ids from being sent to the server as the read marker, which was marking conversations read far beyond their real last message and causing new chat notifications to be immediately deleted.
Assisted-by: Claude Code 2.1.199:claude-sonnet-5
This should ensure unrealistic high messageIds for lastReadMessage never make it to the server
馃弫 Checklist
/backport to stable-xx.x馃 AI (if applicable)