-
Notifications
You must be signed in to change notification settings - Fork 401
MSC3672: Sharing ephemeral streams of location data #3672
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
stefanceriu
wants to merge
21
commits into
main
Choose a base branch
from
stefan/ephemeral-location-streaming
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.
+97
−0
Open
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
12066dd
MSC3672: Sharing ephemeral streams of location data
stefanceriu 55fb0ed
Referencing MSCs through PR link instead of rendered.
stefanceriu 861dc4c
Link to encrypted EDUs MSC.
stefanceriu c7c032e
Add to-device alternative.
stefanceriu 2a26b20
Add more details on EDUs and use cases.
stefanceriu f439d3e
typo
anoadragon453 fb30996
Describe each field in a table, clean up example
anoadragon453 f063795
Clarify m.beacon_info, m.beacon are now defined by this MSC
anoadragon453 440a5d1
Mention that the current design does not support multi-share
anoadragon453 a72bda3
Note MSCs that we depend on
anoadragon453 de543b1
Rename Encryption section to Security considerations, and add another
anoadragon453 6144b23
Add top-level fields to m.beacon EDU example
anoadragon453 35c20f6
Delete a paragraph that didn't make sense
anoadragon453 a62d237
Clarify some client UI suggestions from multiple shares
anoadragon453 76df8b5
Clarify m.beacon example
anoadragon453 4a922c4
Remove paragraph that was already made clear by MSC2477
anoadragon453 f035694
Remove superfluous inner m.beacon_info dict
anoadragon453 e07abb3
swap type and key columns in the field definition tables
anoadragon453 45389a5
Clean up field definitions, add table for m.beacon
anoadragon453 43d224a
Clarify that m.ts is in milliseconds
anoadragon453 750635d
Remodel to lean heavily on MSC3489, instead of repeating
andybalaam 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
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,108 @@ | ||
# MSC3672 - Sharing ephemeral streams of location data | ||
|
||
## Problem | ||
|
||
[MSC3489](https://github.com/matrix-org/matrix-doc/pull/3489) | ||
focuses on streaming persistent location data for applications that require | ||
historical knowledge. | ||
|
||
While that's perfect for situations in which long term storage of the data is a | ||
non-issue and implied (e.g. flight paths, strava style exercises, fleet | ||
tracking), there are also cases in doing so is undersirable for either privacy | ||
or performance reasons. | ||
|
||
Sharing user live location updates is one of the cases in which privacy is | ||
paramount and where we need the ability to share data in a safe and | ||
non-persistent fashion. | ||
|
||
## Proposal | ||
|
||
This MSC adds the ability to publish short-lived location beacons through the | ||
the use of custom Ephemeral Data Units (EDUs) by building on top of [MSC2477](https://github.com/matrix-org/matrix-doc/pull/2477). | ||
|
||
Ephemeral data units (EDUs) are Matrix's default mechanism for broadcasting | ||
short-lived data to a group of users and with the advent of user-defined ones | ||
they perfectly fit live location sharing. | ||
They are intended to be non-persistent, not take part in a room's history and | ||
are currently used for typing notifications, event receipts, and presence | ||
updates. As an extra precaution they can also be encrypted as defined in [MSC3673](https://github.com/matrix-org/matrix-doc/pull/3673). | ||
|
||
We will start by introducing a new boolean property on `m.beacon_info` called | ||
`live` which will mark the start of an user's intent to share ephemeral location | ||
information. | ||
|
||
```json5 | ||
{ | ||
"type": "m.beacon_info.@stefan:matrix.org", | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"state_key": "@stefan:matrix.org", | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"content": { | ||
"m.beacon_info": { | ||
"description": "Stefan's live location", | ||
"timeout": 600000, // how long from the last event until we consider the beacon inactive in milliseconds | ||
"live": true // this is a live location beacon | ||
}, | ||
"m.ts": 1436829458432, // creation timestamp of the beacon on the client | ||
"m.asset": { | ||
"type": "m.self.live" // live user location tracking | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
``` | ||
|
||
We define this new property in order to allow clients to distinguish between | ||
share types without potentially overwriting static ones. | ||
|
||
Multiple live beacons on the same timeline have the option of either aggregating | ||
all available location EDUs or just the ones referencing a particular | ||
`beacon_info`. | ||
|
||
Subsequently clients will start sending beacon data EDUs to the new | ||
`rooms/{roomId}/ephemeral/{eventType}/{txnId}` endpoint where `eventType` equals | ||
`m.beacon` with the same location payload as defined in [MSC3489](https://github.com/matrix-org/matrix-doc/pull/3489). | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
```json5 | ||
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"m.relates_to": { // from MSC2674: https://github.com/matrix-org/matrix-doc/pull/2674 | ||
"rel_type": "m.reference", // from MSC3267: https://github.com/matrix-org/matrix-doc/pull/3267 | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"event_id": "$beacon_info" | ||
}, | ||
"m.location": { | ||
"uri": "geo:51.5008,0.1247;u=35", | ||
"description": "Arbitrary beacon information" | ||
}, | ||
"m.ts": 1636829458432, | ||
} | ||
``` | ||
|
||
These will reach clients through `/sync`s `ephemeral` dictionary with the same | ||
payload but with the addition of a `sender` which the clients can aggregate user | ||
locations on. | ||
|
||
When the user decides they would like to stop sharing their live location the | ||
original `m.beacon_info`'s `live` property should be set to `false`. | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Encryption | ||
|
||
End to end encryption for ephemeral data units isn't currently available but a | ||
mechanism for achieving that is defined separately in [MSC3673](https://github.com/matrix-org/matrix-doc/pull/3673) | ||
|
||
## Alternatives | ||
|
||
Alternatively, we could negotiate a WebRTC data channel using [MSC3401](https://github.com/matrix-org/matrix-doc/pull/3401) | ||
and stream low-latency geospatial data over the participating devices in the | ||
room. However it would be useful to support plain HTTP like the rest of Matrix | ||
and requiring a WebRTC stack is prohibitively complicated for simple clients | ||
(e.g. basic IOT devices reporting spatial telemetry). | ||
|
||
Another alternative is to use to-device events but that comes with disadvantages | ||
of its own as they're 1:1, single message per transaction and not intended for | ||
conversational data. | ||
|
||
stefanceriu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Unstable prefix | ||
|
||
* `m.beacon_info.*` should be referred to as `org.matrix.msc3489.beacon_info.*` until this MSC lands. | ||
* `m.beacon` should be referred to as `org.matrix.msc3489.beacon` until this MSC lands. | ||
* `m.location` should be referred to as `org.matrix.msc3488.location.*` until MSC3488 lands. | ||
* `m.ts` should be referred to as `org.matrix.msc3488.ts.*` until MSC3488 lands. | ||
* `m.asset` should be referred to as `org.matrix.msc3488.asset.*` until MSC3488 lands. | ||
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
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.