-
Notifications
You must be signed in to change notification settings - Fork 437
MSC4454: Deprecating Spoiler Fallback In Media Repository #4454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dozro
wants to merge
13
commits into
matrix-org:main
Choose a base branch
from
dozro:deprecate-spoiler-plaintext-fallback
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+107
−0
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9f1be63
initial MSC version to propose removal of media repo fallback for spo…
dozro 1c57541
adjusted the filename to include the actual MSC number
dozro 427e8ca
adjusted the markdown heading to include the actual MSC number
dozro 2ff6a9d
added link to the spec where spoiler messages are described
dozro 3d0f49c
Change MUST to SHOULD for spoiler content handling
dozro 7e0c276
changed format of plain text spoiler
dozro 3f36f39
formatting of markdown file
dozro 01237da
removed some no longer applicable considerations
dozro 174df83
refine MSC4454 by removing ambiguous specification language for spoil…
dozro ffbf4fc
clarify that the proposal does not affect `formatted_body` and refine…
dozro 95350e3
some phrasing polishing :3
dozro dd112e0
fix silly heading level :3
dozro d56d0fa
applied @tulir feedback :3 (thanks)
dozro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
proposals/4454-deprecating-spoiler-fallback-in-media-repository.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # MSC4454: Deprecating Spoiler Fallback In Media Repository | ||
|
|
||
| This MSC removes specification text that describes unused client behavior for | ||
| spoiler fallbacks, since it is ambiguous and could be interpreted as encouraging | ||
| plaintext storage of spoilered content in end-to-end encrypted contexts. | ||
|
|
||
| This proposal prioritizes preventing unintended disclosure of spoilered content | ||
| over preserving plaintext fidelity. | ||
|
|
||
| ## Proposal | ||
|
|
||
| The | ||
| [spec now (10.2.2.6 in v1.18)](https://spec.matrix.org/v1.18/client-server-api/#spoiler-messages) | ||
| reads that a client should provide a plaintext (`body`) of | ||
| `Alice [Spoiler](mxc://example.org/abc123) in the movie.` when a message is | ||
| spoilered. | ||
|
|
||
| This behavior is not implemented by known clients and represents unnecessary | ||
| specification complexity. It is not appropriate to keep this text in the spec, | ||
| because a client implementing it could leak message text when sending spoilered | ||
| content in an end-to-end encrypted (E2EE) room. The current spec does not | ||
| specify how spoilers should be handled in E2EE rooms and could be read as | ||
| suggesting uploading spoilered text unencrypted to the media repository. | ||
|
|
||
| This proposal removes the recommended fallback for spoilers in `body`. The | ||
| plaintext representation of spoilers is left as an implementation detail. | ||
|
|
||
| Spoiler-aware clients SHOULD NOT display body anywhere when there are spoilers | ||
| in `formatted_body`. For contexts like room list previews and notifications | ||
| where a plain text representation is needed, clients SHOULD either generate | ||
| plain text from the HTML locally, or simply display a placeholder message when | ||
| any spoilers are detected. | ||
|
|
||
| This proposal does not affect `formatted_body`. | ||
|
|
||
| ## Potential issues | ||
|
|
||
| Inconsistent behavior between clients. | ||
|
|
||
| Anyhow this is already basically the reality nowadays, so nothing lost, nothing | ||
| won. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| This proposal removes the previous guidance that suggested a specific way to | ||
| populate the `body` for spoilered messages. It does not introduce a new required | ||
| behavior; implementations may continue using any approach that fits their design | ||
| model. In other words, removing the recommendation makes multiple client | ||
| behaviours spec-compliant rather than prescribing one. | ||
|
|
||
| Below are two common approaches implemented by clients today. They are shown as | ||
| examples and are not being mandated by this proposal. | ||
|
|
||
| ### Alternative 1: Include the spoilered content verbatim in `body` | ||
|
|
||
| Some clients (for example Element Web) put the plaintext of the spoiler into the | ||
| `body` field and use `formatted_body` to mark the spoiler in HTML | ||
| (`data-mx-spoiler`). | ||
|
|
||
| Example (Element Web style): | ||
|
|
||
| ```json | ||
| { | ||
| "msgtype": "m.text", | ||
| "format": "org.matrix.custom.html", | ||
| "body": "test meow", | ||
| "formatted_body": "<span data-mx-spoiler>test meow</span>", | ||
| "m.mentions": {} | ||
| } | ||
| ``` | ||
|
|
||
| ### Alternative 2: Mark spoilers in plaintext with delimiters (e.g. `||`) | ||
|
|
||
| Insert a plaintext delimiter around spoiler text (Cinny uses `||`, so just | ||
| discord-style) and also provide a `formatted_body` with a spoiler markup for | ||
| HTML renderers. | ||
|
|
||
| Example (Cinny style): | ||
|
|
||
| ```json | ||
| { | ||
| "msgtype": "m.text", | ||
| "format": "org.matrix.custom.html", | ||
| "body": "||test meow||", | ||
| "formatted_body": "<span data-md=\"||\" data-mx-spoiler>test meow</span>", | ||
| "m.mentions": {} | ||
| } | ||
| ``` | ||
|
|
||
| ### Summary | ||
|
|
||
| This proposal intentionally removes prescriptive guidance so that clients are | ||
| free to choose an approach that balances compatibility and privacy. All of the | ||
| approaches illustrated above are spec-compliant under this change. | ||
|
|
||
| ## Security considerations | ||
|
|
||
| This change reduces the risk of accidental plaintext leakage via media | ||
| repositories. | ||
|
|
||
| ## Unstable prefix | ||
|
|
||
| Not applicable | ||
|
|
||
| ## Dependencies | ||
|
|
||
| None |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation requirements: None, the latest version of the proposal only removes parts of the spec