bridgev2/portal: don't fail message handling when the event is already bridged - #532
Open
Fizzadar wants to merge 1 commit into
Open
bridgev2/portal: don't fail message handling when the event is already bridged#532Fizzadar wants to merge 1 commit into
Fizzadar wants to merge 1 commit into
Conversation
…y bridged If a connector re-IDs a message row (e.g. when an edit arrives), a redelivery of the original network message misses the duplicate check and then collides on the message mxid unique constraint, which fails the whole remote event. Treat an insert that conflicts with an existing row for the same mxid as an already-handled duplicate instead of a database error. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fizzadar
marked this pull request as ready for review
July 28, 2026 15:45
Member
|
Hmm, checking the mxid only works for local, so it'd probably be better if the signal bridge inserted a stub message row for each old revision |
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.
When a connector re-IDs an existing message row (mautrix-signal does this on edits, pointing the row at the edit's timestamp so chained edit targets resolve), a redelivery of the original network message misses the duplicate check in
handleRemoteMessage, which keys on the network ID.With an intent that generates deterministic event IDs the resend then returns the row's existing mxid, so the insert dies on
message_mxid_uniqueand the whole remote event is reported as failed — on Signal that means the envelope is never acked and the receive queue stays wedged until re-link.This treats an insert conflicting with an existing row for the same mxid as an already-handled duplicate instead of a database error.