Skip to content

bridgev2/portal: don't fail message handling when the event is already bridged - #532

Open
Fizzadar wants to merge 1 commit into
mainfrom
nick/skip-already-bridged-message-parts
Open

bridgev2/portal: don't fail message handling when the event is already bridged#532
Fizzadar wants to merge 1 commit into
mainfrom
nick/skip-already-bridged-message-parts

Conversation

@Fizzadar

@Fizzadar Fizzadar commented Jul 28, 2026

Copy link
Copy Markdown
Member

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_unique and 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.

…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
Fizzadar marked this pull request as ready for review July 28, 2026 15:45
@Fizzadar
Fizzadar requested a review from tulir July 28, 2026 15:45
@tulir

tulir commented Jul 28, 2026

Copy link
Copy Markdown
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

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.

2 participants