Skip to content
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

WIP: MSC3277: Scheduled messages #3277

Open
wants to merge 19 commits into
base: old_master
Choose a base branch
from
Open

WIP: MSC3277: Scheduled messages #3277

wants to merge 19 commits into from

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Jul 10, 2021

@ara4n ara4n added the proposal A matrix spec change proposal label Jul 10, 2021
@turt2live turt2live added client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff proposal-in-review requires-room-version An idea which will require a bump in room version and removed proposal-in-review labels Jul 10, 2021
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ to denote read-up-to

proposals/3277-scheduled-messages.md Show resolved Hide resolved
@turt2live turt2live removed the requires-room-version An idea which will require a bump in room version label Jul 10, 2021
Copy link
Contributor

@ShadowJonathan ShadowJonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes, but this is already fairly solid 👍

Imo it also would need a JSON example of a schedule message, but that's minor.

proposals/3277-scheduled-messages.md Outdated Show resolved Hide resolved
proposals/3277-scheduled-messages.md Show resolved Hide resolved
proposals/3277-scheduled-messages.md Outdated Show resolved Hide resolved
proposals/3277-scheduled-messages.md Outdated Show resolved Hide resolved
proposals/3277-scheduled-messages.md Outdated Show resolved Hide resolved
proposals/3277-scheduled-messages.md Show resolved Hide resolved
proposals/3277-scheduled-messages.md Show resolved Hide resolved
@ara4n
Copy link
Member Author

ara4n commented Jul 13, 2021

@ShadowJonathan thanks for excellent review - have incorporated all feedback (i think).

Copy link
Contributor

@ShadowJonathan ShadowJonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as-is

proposals/3277-scheduled-messages.md Outdated Show resolved Hide resolved
"sender": "@matthew:matrix.org",
"type": "m.room.message",
"unsigned": {
"age": 391
Copy link
Contributor

@ShadowJonathan ShadowJonathan Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add "scheduled": true to unsigned here? Just to simplify client logic.

Comment on lines +36 to +37
The server must set the `origin_server_ts` of the message is set to be its
`at` time, given in practice this is the label used for clients to display

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be done if the at timestamp is "reasonable". For example if the timestamp is in the past the server should probably still set origin_server_ts as it would if the event was not scheduled. For example this could occur if a scheduled message was sent while offline and the device did not come online until after the send time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "server should clamp past time stamps" can get finicky if the clocks of the server and the client aren't synchronized.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but I don't think the server always trusts the client enough to pick arbitrary timestamps. This could lead to confusing behaviour. I get that this is possible over federation with a malicious server anyways but it seems like this confusing behaviour should be avoided when it is simple to do a pretty good job. We are already trusting the server clock for when to publish the message so it seems that the server slot is expected to be vaguely in sync anyways.

TL;DR if the field is called origin_server_ts the server should have the final say. I don't think it is actually too important that we require precise semantics but I think we should allow the server a clean way to avoid sending known-invalid timestamps. If you don't like clamping we can consider rejecting the message upon being queued. However this is really pushing the timestamp-guessing onto the client which is more flexible but probably suboptimal for most use-cases.

proposals/3277-scheduled-messages.md Outdated Show resolved Hide resolved
to send the message at the right time, which feels fragile (or encourages a
longlived serverside client/bot to be run, which could put E2EE at risk).

## Security considerations

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the client queues the E2EE event they have no way of stopping the server from sending it. Of course there is always a race condition here but the server could publish at any time even if the user changes their mind. This could be somewhat mitigated by clients throwing away that key ASAP which could prevent anyone from decrypting the message.

For example consider that Alice wants to share information to Mallory, but only in 2 weeks time. If Mallory could break into Alice's server Mallory can force-send that message beforehand (or just exfiltrate that message).

However I think that in general this is the required tradeoff to allow sending the message while the client is not online.

@turt2live turt2live added the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Jul 18, 2021
@JMoVS
Copy link

JMoVS commented Jan 23, 2024

I was almost going to write up my own proposal but then discovered this. thumbs up - this would be a really really great feature to have in business contexts!

messages (i.e. megolm sessions with `m.forward_until` fields), given they may
be shared long in advance of the scheduled message.

## Possible issues
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This MSC allows the server to set origin_server_ts to a future date, but if it doesn't then there's a bit of a privacy leak: https://twitter.com/soren_iverson/status/1785308725362016505 (not a real feature)

@mpeter50
Copy link

I was almost going to write up my own proposal but then discovered this. thumbs up - this would be a really really great feature to have in business contexts!

Not only in a business context, I think. I often use such messages to set up reminders using an other messaging platform.

I know this is not the proper way to do reminders, but the todo software "collection" I use across my devices often only syncs at half an hour intervals or such (and since the operation is heavy enough, I dont want it to be any more requent), so for short term reminders this is more reliable.
But then this also solves reminders for an arbitrary group of friends who are available over Matrix (and any bridged platforms), which is an additional feature even if that todo stack was quick to sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants