Skip to content

portalbackfill: keep never-bridged messages in forward backfill dedup#517

Closed
Fizzadar wants to merge 2 commits into
mainfrom
nick/plat-36990-backfill-id-dedup
Closed

portalbackfill: keep never-bridged messages in forward backfill dedup#517
Fizzadar wants to merge 2 commits into
mainfrom
nick/plat-36990-backfill-id-dedup

Conversation

@Fizzadar

@Fizzadar Fizzadar commented Jun 16, 2026

Copy link
Copy Markdown
Member

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.

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.
messages = messages[cutoff+1:]
}
} else {
} else if !forward {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we apply the aggressiveDedup guard here too so both forward/backward are the same (aggressive is forced and any prefix shortcuts disabled).

@Fizzadar Fizzadar marked this pull request as ready for review June 16, 2026 15:56
@Fizzadar Fizzadar requested a review from tulir June 16, 2026 15:56
@Fizzadar Fizzadar changed the title PLAT-36990: keep never-bridged messages in forward backfill dedup portalbackfill: keep never-bridged messages in forward backfill dedup Jun 16, 2026
@Fizzadar Fizzadar closed this Jun 30, 2026
@Fizzadar Fizzadar deleted the nick/plat-36990-backfill-id-dedup branch June 30, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant