Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

redactions are not relayed to clients if the original event has been deleted (eg via message retention) #12603

Open
Fred-Treebal opened this issue May 2, 2022 · 6 comments
Labels
A-Message-Retention-Policies Issues related to Synapse's support of MSC1763 (message retention policies) T-Other Questions, user support, anything else.

Comments

@Fred-Treebal
Copy link

On our mobile client, we use the redact WS (https://matrix.org/docs/spec/r0.0.1/client_server.html#put-matrix-client-api-r0-rooms-roomid-redact-eventid-txnid) when a user wants to remove one of his messages. It works fine for recent messages. But, in our matrix configuration, we use a short retention period of messages (7 days). When a user wants to delete a message older than 7 days (visible/cached on client but purged from the homeserver), it seems that the ‘redact’ WS does not trigger anything. No event of type m.room.redaction is sent to the mobile clients through the sync for the deleted event.

Could the deletion/redaction mechanism be made to work regardless of the homeserver retention period ?

@H-Shay
Copy link
Contributor

H-Shay commented May 2, 2022

I'm slightly confused here, you would like the option to redact events that have already been deleted from a homeserver but are still visible locally in the client? I think most clients give the option to delete the message locally-perhaps there is something I am missing here?

@H-Shay H-Shay added the X-Needs-Info This issue is blocked awaiting information from the reporter label May 2, 2022
@ShadowJonathan
Copy link
Contributor

(Note that that is a very old specification version, this version is more recent)

@Fred-Treebal
Copy link
Author

I'm slightly confused here, you would like the option to redact events that have already been deleted from a homeserver but are still visible locally in the client? I think most clients give the option to delete the message locally-perhaps there is something I am missing here?

The idea would be to not only delete the msg locally but also on destination devices (to keep the same behaviour as a recent message deletion), if matrix relayed redaction events even on deleted events this would trigger a "normal" event deletion on receivers devices also.

@richvdh
Copy link
Member

richvdh commented May 4, 2022

If matrix relayed redaction events even on deleted events

This is tricky. In order to stop people trying to redact other peoples' messages, Matrix servers deliberately withhold redaction events until the server has confirmed that the redaction is valid. This is specified in https://spec.matrix.org/v1.2/rooms/v3/#handling-redactions:

If the server would apply a redaction, the redaction event is also sent to clients. Otherwise, the server simply waits for a valid partner event to arrive where it can then re-check the above.

Unfortunately, message retention is something of an experimental feature, and bugs like this are to be expected.

@richvdh richvdh changed the title Redact events that no longer exist on the Matrix server redactions are not relayed to clients if the original event has been deleted (eg via message retention) May 4, 2022
@richvdh richvdh removed the X-Needs-Info This issue is blocked awaiting information from the reporter label May 4, 2022
@ShadowJonathan
Copy link
Contributor

Unfortunately, message retention is something of an experimental feature, and bugs like this are to be expected.

Personally, I'd suggest then keeping this issue open, and allow it to provide feedback to MSC1763 & friends wrt possible sync extensions or other client-facing "nudges"

@anoadragon453
Copy link
Member

@ShadowJonathan I would argue that such issues should be transferred back to the MSC as PR review comments? Such as "Synapse found this difficult to implement because of...".

As for this particular issue, MSC1763 (for which Synapse's message retention is an implementation of), tries to solve this problem by storing the retention periods in state. Clients are then expected to read this information and remove messages themselves, without the need for the homeserver to command a deletion for each message. There's also a boolean that controls whether clients should do this (in case messages are only deleted to save resources on the homeserver): expire_on_clients.

@anoadragon453 anoadragon453 added the T-Other Questions, user support, anything else. label May 9, 2022
@clokep clokep added the A-Message-Retention-Policies Issues related to Synapse's support of MSC1763 (message retention policies) label May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Message-Retention-Policies Issues related to Synapse's support of MSC1763 (message retention policies) T-Other Questions, user support, anything else.
Projects
None yet
Development

No branches or pull requests

6 participants