|
| 1 | +# MSC3676: Transitioning away from reply fallbacks. |
| 2 | + |
| 3 | +## Problem |
| 4 | + |
| 5 | +As per [MSC2781](https://github.com/matrix-org/matrix-doc/pull/2781) |
| 6 | +(Remove reply fallbacks), the current reply fallback implementation is very |
| 7 | +problematic: |
| 8 | + * Its quotes leak history which may not be visible to the user |
| 9 | + * The quoted sections may trigger unexpected notifications |
| 10 | + * `<mx-reply/>` tags are hard and dangerous to manipulate, and have caused |
| 11 | + multiple vulnerabilities in clients |
| 12 | + * They don't localise. |
| 13 | + |
| 14 | +[MSC2781](https://github.com/matrix-org/matrix-doc/pull/2781) proposes |
| 15 | +removing them entirely. However, this triggers a relatively large cascade of |
| 16 | +additional dependent work: |
| 17 | + * Some users rely on their mxid existing in fallbacks to notified when |
| 18 | + someone replies to their messages. So we'd need to create and implement |
| 19 | + new push rules to recreate this feature ([MSC3664](https://github.com/matrix-org/matrix-doc/pull/3664)). |
| 20 | + * The push rules are even more complicated than expected for this, because |
| 21 | + they also would need to stop replies which are used as fallback for |
| 22 | + threads (as per [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440)) |
| 23 | + from firing notifications. |
| 24 | + * In the absence of fallbacks, in order to render replies simple clients will |
| 25 | + now have to parse `m.in_reply_to` objects and fish around for the missing |
| 26 | + events (or ask the server to bundle the replies, which is not yet a |
| 27 | + thing). |
| 28 | + |
| 29 | +Meanwhile, [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440) |
| 30 | +(Threads) uses replies as a fallback representation for threads (which is |
| 31 | +very desirable to support clients while the threads transition is happening, |
| 32 | +or to support simpler clients which support replies but not threads). |
| 33 | +However, currently `m.in_reply_to` is only allowed on `m.room.message` events |
| 34 | +of msgtype `m.text`, which means it cannot currently be used as a fallback |
| 35 | +for arbitrary threaded events. |
| 36 | + |
| 37 | +## Proposal |
| 38 | + |
| 39 | +As a transitional step towards removing reply fallbacks entirely, instead: we |
| 40 | +make reply fallbacks best effort. Specifically: |
| 41 | + |
| 42 | + * `m.in_reply_to` is relaxed to apply to any event type |
| 43 | + * In practice only `m.room.message` events with msgtype `m.text` or similar |
| 44 | + (`m.emote`, `m.notice`) would be able to express reply fallbacks (using the |
| 45 | + `m.body`, `format` and `formatted_body` fields). |
| 46 | + * Thread events using replies as a fallback representation for threads should |
| 47 | + not include a textual reply fallback at all (and so avoid threaded messages |
| 48 | + triggering notifications). The same would apply for any other usage which uses |
| 49 | + replies as a fallback. |
| 50 | + |
| 51 | +This means that we can still use reply fallbacks for notification purposes |
| 52 | +until that is properly fixed by [MSC2781](https://github.com/matrix-org/matrix-doc/pull/2781) |
| 53 | +and [MSC3664](https://github.com/matrix-org/matrix-doc/pull/3664) - decoupling this |
| 54 | +additional work from landing threads in |
| 55 | +[MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). |
| 56 | +Replying to a message with an attachment won't trigger a notification, but |
| 57 | +this is no worse than the behaviour today. |
| 58 | + |
| 59 | +## Alternatives |
| 60 | + |
| 61 | +We could remove fallbacks entirely and do all the subsequent work needed to |
| 62 | +support that ([MSC2781](https://github.com/matrix-org/matrix-doc/pull/2781), |
| 63 | +[MSC3664](https://github.com/matrix-org/matrix-doc/pull/3664) and whatever |
| 64 | +MSC handles thread+fallback notification interaction). However, |
| 65 | +we believe that adding threads to Matrix is (much) higher priority and |
| 66 | +value for Matrix than cleaning up edge cases around reply fallbacks, and |
| 67 | +given the two can be decoupled, they should be. The importance of threads is |
| 68 | +based on the fact that we're seeing Matrix repeatedly fail to be selected as |
| 69 | +a collaboration technology thanks to other alternatives supporting |
| 70 | +Slack-style threads. |
| 71 | + |
| 72 | +We could not use `m.in_reply_to` as a fallback for clients which don't |
| 73 | +understand `m.thread`, but this would result in an unnecessarily |
| 74 | +terrible fallback for older/transitional/WIP/simple clients. |
| 75 | + |
| 76 | +## Security |
| 77 | + |
| 78 | +By temporarily keeping reply fallbacks around on a best effort basis, we're |
| 79 | +still vulnerable to their security risks. Client implementors should read |
| 80 | +the [security issues highlighted in MSC2781](https://github.com/deepbluev7/matrix-doc/blob/drop-the-fallbacks/proposals/2781-down-with-the-fallbacks.md#appendix-b-issues-with-the-current-fallbacks) |
| 81 | +if implementing reply fallbacks. |
| 82 | + |
| 83 | +## Unstable prefix |
| 84 | + |
| 85 | +None needed. |
| 86 | + |
| 87 | +## Dependencies |
| 88 | + |
| 89 | +None. (MSC3440 will depend on this, however) |
0 commit comments