portalbackfill: keep never-bridged messages in forward backfill dedup#517
Closed
Fizzadar wants to merge 2 commits into
Closed
portalbackfill: keep never-bridged messages in forward backfill dedup#517Fizzadar wants to merge 2 commits into
Fizzadar wants to merge 2 commits into
Conversation
Forward backfill could permanently lose messages when a reconnect snapshot advanced the sync cursor past threads it didn't include, leaving mid-timeline gaps older than the portal anchor. Skip the forward timestamp prefix-trim in cutoffMessages when AggressiveDeduplication is set so the ID-based dedup pass decides what is already bridged, retaining never-bridged messages older than the anchor.
Fizzadar
commented
Jun 16, 2026
| messages = messages[cutoff+1:] | ||
| } | ||
| } else { | ||
| } else if !forward { |
Member
Author
There was a problem hiding this comment.
Should we apply the aggressiveDedup guard here too so both forward/backward are the same (aggressive is forced and any prefix shortcuts disabled).
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.
See mautrix/meta#286
But basically - aggressive dupe should probably not do prefix deleting as it breaks the "check each message" approach, which in meta's case can lead to permanently lost messages.