fix: whatsapp archive lthash mismatch and UI history refresh#504
Open
asemarafa wants to merge 1 commit intod99kris:masterfrom
Open
fix: whatsapp archive lthash mismatch and UI history refresh#504asemarafa wants to merge 1 commit intod99kris:masterfrom
asemarafa wants to merge 1 commit intod99kris:masterfrom
Conversation
- Request app state recovery upon LTHash mismatch in whatsmeow. - Clear requested message IDs and refresh UI history when a chat is unarchived in uimodel.
Owner
|
Hi @asemarafa - thanks for contributing again. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR addresses the issue where WhatsApp chats fail to sync their archive/unarchive state properly when modified from another device (e.g.,
a phone) while nchat is offline or disconnected.
What this fixes:
ErrMismatchingLTHash in whatsmeow: When the local app state hash does not match the server's hash, whatsmeow previously failed silently on
ErrMismatchingLTHash. This patch catches the error and explicitly sends a BuildAppStateRecoveryRequest to heal the local state.
UI History Refresh (uimodel.cpp): When a chat is unarchived, the application sends a request for new messages. However, prior message
requests might have been silently dropped by the NewMessagesNotify handler when the chat was still considered archived locally. This
clears any previously requested message IDs and calls UpdateHistory() to ensure the UI accurately reflects any messages that arrived while
the chat was archived.