Skip to content

bridgev2: send notice when edit target is too old or has too many edits#501

Open
Deln0r wants to merge 1 commit into
mautrix:mainfrom
Deln0r:fix/issue-404-edit-too-old-notice
Open

bridgev2: send notice when edit target is too old or has too many edits#501
Deln0r wants to merge 1 commit into
mautrix:mainfrom
Deln0r:fix/issue-404-edit-too-old-notice

Conversation

@Deln0r
Copy link
Copy Markdown

@Deln0r Deln0r commented May 13, 2026

Closes #404.

Problem

ErrEditTargetTooOld and ErrEditTargetTooManyEdits are returned from (*Portal).handleMatrixMessage when the user tries to edit a Matrix message that the remote network no longer accepts an edit for (e.g. WhatsApp's 15-minute edit window, or a network with EditMaxCount reached). The current handler fails silently for both, leaving the user with no indication that their edit did not propagate.

Fix

Add .WithSendNotice(true) to both errors so the existing message-status notice mechanism informs the user. The matching pattern is already used by other "you tried to send something the bridge can't deliver" errors in the same file (ErrUnsupportedMessageType, ErrMediaTooLarge, ErrMediaDurationTooLong, etc.).

Scope

This PR covers only the user-notification piece of #404. The optional second proposal in the issue — reverting the local Matrix edit so the chat stays consistent with the bridged version — is a larger change touching the portal redaction path and is left for a follow-up.

ErrEditTargetTooOld and ErrEditTargetTooManyEdits are returned from
the EditMaxAge / EditMaxCount checks in (*Portal).handleMatrixMessage
when the user tries to edit a Matrix message that the remote network
no longer accepts an edit for (e.g. WhatsApp's 15-minute edit
window). The handler currently fails silently for both, leaving the
user to wonder why their edit did not propagate. Add .WithSendNotice(true)
so the standard message-status notice mechanism informs the user that
the edit could not be bridged.

The matching sibling errors that already notify the user
(ErrUnsupportedMessageType, ErrMediaTooLarge, etc.) use the same
construction pattern.

The optional "revert the local edit" piece mentioned in mautrix#404 is a
larger change and is left for a follow-up.

Closes mautrix#404.
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.

No user feedback when matrix-edited message is not sent to remote due to EditMaxAge

1 participant