Repository navigation
backfill: move on-demand anchor past batches that convert to nothing - #1056
Open
indent[bot] wants to merge 2 commits into
Open
indent[bot] wants to merge 2 commits into
indent[bot] wants to merge 2 commits into
Conversation
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.
Logs
No messages to backfill, but HasMore is true: 560 in 24 h vs 86 the day before. Loki samples (15-min windows on 3 clusters, Nov 13-14) show at least 4 accounts, each stuck on one chat during manual scroll-back. One account sent 259 requests in 8 minutes. Every round does the same thing: a history sync request with the same anchor, an ON_DEMAND reply with 50 messages andCOMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY, 0 converted, an unchanged cursor, andhas_more=true.Cause
handleOnDemandHistorySyncskipsignore-type messages (content-less stubs). When the whole batch is skipped it returns no messages butHasMore.fetchMessagesFromPhonealways anchors on the oldest bridged message, which didn't move, so the phone returns the same batch forever and older history is unreachable.Change
When an on-demand batch converts to nothing, the cursor carries the oldest skipped message key (timestamp, fromMe, ID).
fetchMessagesFromPhoneanchors on it when it's older than the oldest bridged message.FetchMessagesreads only the cursor's timestamp part, so existing cursors work unchanged.Before / after
Note: not tested against a live account.
Tag
@indentto continue the conversation here.