matrix-org / matrix-org/matrix-spec

Message Drafts

Open
#764 2 comments 1 reaction 0 assignees View on GitHub
feature
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

I haven't bothered to write an MSC but can open one if there is interest.

There should be a way to save and sync drafts across clients. These drafts should probably be e2e encrypted. (It would be possible to support unencrypted drafts but I would prefer not to).

The concept is very simple: When a user is composing a message the client occasionally saves the in-progress message, encrypts it only to the user themselves and sends the message to the server.

Concerns:

- Server load.
- What is the ideal frequency of drafts. Should the sever suggest a rate limit?
- Should attachments be saved as drafts (probably not for now, but I can see the use case).
- Privacy
- Should we support unencrypted drafts? I think we probably shouldn't. This is because even if it is intended for an unencrypted room users will often accidentally paste the wrong data into the compose field. In order to avoid sending unintended sensitive data to the server all drafts should probably be e2e encrypted.
- Maybe we can recommend that clients use an explicit "save" button if e2e encryption keys are not available.
- Can the speed at which something is typed and size of the encrypted blob give away information?
- We probably should avoid compressing drafts.
- With a long enough delay between sending drafts (example: 10s on frequent activity, 2s of idleness) it shouldn't be a major issue.
- Concurrency
- Clients will need to handle the case where there are multiple drafts in a single room (for example if a draft is created on two offline devices that then come online)

Possibly related:

Timed messages: One may think of a timed message similar to a draft that has been scheduled to send however these need to be handled differently. While you may be able to edit a timed message before it sends a timed message would need to be encrypted to all recipients. A draft is only encrypted to a user's own devices. Furthermore it may be common to have many timed messages whereas the number of concurrent drafts is likely small. When editing a timed message it might also make sense to save a draft of that message. It seems like the use cases are different enough that separate proposals and APIs makes more sense.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the proposal's open questions around encryption, save frequency, attachments, and concurrent drafts, then determine whether an MSC should define the behavior. The work is done when the protocol scope, draft storage and synchronization model, encryption requirements, and client/server APIs have been agreed and documented.

Written by the indexing model from the issue text.

Assessment

Domain
backend-api-design, distributed-systems, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.