Skip to content

feat(ui): timeline live location sharing support#6232

Merged
stefanceriu merged 12 commits intomainfrom
stefan/uiLiveLocationSharing
Mar 5, 2026
Merged

feat(ui): timeline live location sharing support#6232
stefanceriu merged 12 commits intomainfrom
stefan/uiLiveLocationSharing

Conversation

@stefanceriu
Copy link
Copy Markdown
Member

This PR implements MSC3489 live location sharing support in the matrix-sdk-ui timeline layer and exposes it through the matrix-sdk-ffi FFI bindings by aggregating org.matrix.msc3672.beacons into their parent org.matrix.msc3672.beacon_info and exposing them as a new TimelineItemContent::LiveLocation variant.

beacon_info state events that have their live flag set to true will create a new timeline item while non-live ones will try to update the existing timeline item, if found.

The design follows the same aggregation model already in use for polls and choses the LiveLocation naming scheme for everything on top of the UI Timeline, abstracting the idea of beacons.

  • I've documented the public API Changes in the appropriate CHANGELOG.md files.
  • This PR was made with the help of AI.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 3, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing stefan/uiLiveLocationSharing (2cc4894) with main (007eb15)

Open in CodSpeed

@stefanceriu stefanceriu changed the title Stefan/UI live location sharing feat(ui): timeline live location sharing support Mar 3, 2026
@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from 19a1efc to 03dc078 Compare March 3, 2026 11:50
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 80.60606% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.89%. Comparing base (21e8138) to head (2cc4894).
⚠️ Report is 19 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...rix-sdk-ui/src/timeline/controller/aggregations.rs 72.91% 13 Missing ⚠️
...i/src/timeline/event_item/content/live_location.rs 71.42% 12 Missing ⚠️
...trix-sdk-ui/src/timeline/event_item/content/mod.rs 66.66% 1 Missing and 3 partials ⚠️
crates/matrix-sdk-ui/src/timeline/event_handler.rs 96.72% 2 Missing ⚠️
...rates/matrix-sdk-ui/src/timeline/event_item/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6232      +/-   ##
==========================================
- Coverage   89.90%   89.89%   -0.01%     
==========================================
  Files         371      372       +1     
  Lines      102281   102443     +162     
  Branches   102281   102443     +162     
==========================================
+ Hits        91958    92094     +136     
- Misses       6762     6786      +24     
- Partials     3561     3563       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ganfra
Copy link
Copy Markdown
Contributor

ganfra commented Mar 3, 2026

Tested on android, working nicely!

@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from 03dc078 to 87b8983 Compare March 3, 2026 14:42
@stefanceriu stefanceriu marked this pull request as ready for review March 3, 2026 16:17
@stefanceriu stefanceriu requested a review from a team as a code owner March 3, 2026 16:17
@stefanceriu stefanceriu requested review from bnjbvr and removed request for a team March 3, 2026 16:17
@ganfra
Copy link
Copy Markdown
Contributor

ganfra commented Mar 3, 2026

@stefanceriu can you make sure to expose the body and the assetType in the LiveLocationContent?

Also if I clear the cache, it looks like the aggregation gets broken : sometimes the live location is displayed as live even if it's finished, something its completly missing from the timeline :/

@stefanceriu
Copy link
Copy Markdown
Member Author

@stefanceriu can you make sure to expose the body and the assetType in the LiveLocationContent?

m.asset I understand but where's the body coming from? 🤔 Do you mean the description?

Also if I clear the cache, it looks like the aggregation gets broken : sometimes the live location is displayed as live even if it's finished, something its completly missing from the timeline :/

I don't know what that's about but I don't think it's related to this PR. We've seen pinned events break after clearing the cache too if I remember correctly so can you please check the SS responses and see if they match your expectations 🙏

@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from f992b02 to 2040bbd Compare March 4, 2026 08:12
@ganfra
Copy link
Copy Markdown
Contributor

ganfra commented Mar 4, 2026

@stefanceriu can you make sure to expose the body and the assetType in the LiveLocationContent?

m.asset I understand but where's the body coming from? 🤔 Do you mean the description?

body is not the same thing than description, you should have either body or m.text available in the model (or both for compatibility).

Also if I clear the cache, it looks like the aggregation gets broken : sometimes the live location is displayed as live even if it's finished, something its completly missing from the timeline :/

I don't know what that's about but I don't think it's related to this PR. We've seen pinned events break after clearing the cache too if I remember correctly so can you please check the SS responses and see if they match your expectations 🙏

I'll check a bit more

@stefanceriu
Copy link
Copy Markdown
Member Author

body is not the same thing than description, you should have either body or m.text available in the model (or both for compatibility).

As far as I can tell that's not actually available in ruma and the parent MSC3488 (static location sharing) explicitely states that

If both fields are present, clients that speak MSC3488 should favour the contents of the MSC3488 fields over the legacy geo_uri field.

.. so now I'm confused 🤔

@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from 2040bbd to d44624a Compare March 4, 2026 10:11
Copy link
Copy Markdown
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

looking great!

Copy link
Copy Markdown
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Looks good, but I have one concern about the handling of the stop beacon, that I hadn't thought about yesterday.

@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from 1508e11 to 0c53d22 Compare March 5, 2026 10:51
@stefanceriu stefanceriu requested a review from bnjbvr March 5, 2026 10:52
Copy link
Copy Markdown
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from 0c53d22 to a535c25 Compare March 5, 2026 12:55
…ion sharing

# Conflicts:
#	crates/matrix-sdk-ui/src/timeline/event_item/mod.rs
#	crates/matrix-sdk-ui/src/timeline/mod.rs
…d `org.matrix.msc3672.beacon` events and aggregate them onto the timeline's `LiveLocation`

# Conflicts:
#	crates/matrix-sdk-ui/src/timeline/event_handler.rs
@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from a535c25 to c95506d Compare March 5, 2026 13:23
@stefanceriu stefanceriu force-pushed the stefan/uiLiveLocationSharing branch from c95506d to 2cc4894 Compare March 5, 2026 13:39
@stefanceriu stefanceriu enabled auto-merge (rebase) March 5, 2026 13:55
@stefanceriu stefanceriu merged commit 37ae2af into main Mar 5, 2026
52 checks passed
@stefanceriu stefanceriu deleted the stefan/uiLiveLocationSharing branch March 5, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants