Skip to content

sdk: add support for listening to stream of live location updates#4025

Merged
Hywan merged 1 commit intomatrix-org:mainfrom
torrybr:feat/subscribe-beacons
Dec 9, 2024
Merged

sdk: add support for listening to stream of live location updates#4025
Hywan merged 1 commit intomatrix-org:mainfrom
torrybr:feat/subscribe-beacons

Conversation

@torrybr
Copy link
Copy Markdown
Contributor

@torrybr torrybr commented Sep 22, 2024

Conversation related to this issue can be found here

This merge request adds subscribe_to_live_location_shares to the matrix_sdk::Room that allows clients to listen for beacon updates using a background task. The method provides an easy way to subscribe to live location sharing events within a room, handling event processing internally.

Follow-up tasks will include adding support for the event cache.

@torrybr torrybr requested a review from a team as a code owner September 22, 2024 15:36
@torrybr torrybr requested review from bnjbvr and removed request for a team September 22, 2024 15:36
@torrybr torrybr changed the title Add Support for listening to stream of live location updates sdk: add support for listening to stream of live location updates Sep 22, 2024
@bnjbvr bnjbvr requested review from a team and stefanceriu and removed request for a team and bnjbvr September 23, 2024 07:49
@stefanceriu
Copy link
Copy Markdown
Member

Seems that the test aren't particularly happy with this PR. Can you please have a look?

Copy link
Copy Markdown
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I've left some feedback that can impact the global design of your patch.

@torrybr torrybr force-pushed the feat/subscribe-beacons branch from 3b574dd to 7066fb3 Compare September 24, 2024 14:43
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.01%. Comparing base (cefd5a2) to head (e10d8eb).
Report is 175 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4025   +/-   ##
=======================================
  Coverage   85.00%   85.01%           
=======================================
  Files         274      275    +1     
  Lines       29945    29951    +6     
=======================================
+ Hits        25456    25463    +7     
+ Misses       4489     4488    -1     

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

@torrybr torrybr requested a review from Hywan September 24, 2024 15:10
@stefanceriu stefanceriu removed their request for review September 24, 2024 15:17
@torrybr torrybr requested a review from Hywan September 24, 2024 17:30
@torrybr torrybr force-pushed the feat/subscribe-beacons branch 2 times, most recently from 29a2552 to 4cc5b45 Compare November 10, 2024 19:54
@torrybr
Copy link
Copy Markdown
Contributor Author

torrybr commented Nov 10, 2024

Updated with more comprehensive tests and ready for a re-review thanks

Copy link
Copy Markdown
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

I think we are almost done! Can you rebase your git history please?

@torrybr torrybr requested a review from Hywan November 11, 2024 16:38
@Hywan
Copy link
Copy Markdown
Member

Hywan commented Nov 13, 2024

I've just merged #4253, and I believe it might interest you, or may your code a bit simpler. What do you think?

Copy link
Copy Markdown
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

There is still issues with the code (see comments). However, I suggest you to use #4253, where you can return your own subscriber, in which the produced stream can map the stream from EventHandlerSubscriber to generate a LiveLocationShare. See StreamExt::map.

@torrybr
Copy link
Copy Markdown
Contributor Author

torrybr commented Nov 14, 2024

I've just merged #4253, and I believe it might interest you, or may your code a bit simpler. What do you think?

Would you be open to merging this as-is using the existing .add_event_listener approach? I’d like to revisit it next week to refactor based on your new implementation, but it may take me some time to fully get up to speed with the new process. Given that this has been open for a while, merging it now would provide me a solid foundation for completing the rest of the location-sharing feature!

Recent commit makes use of the EventHandlerDropGuard as suggested and keeps it a little simpler without breaking it out.

@torrybr torrybr requested a review from Hywan November 14, 2024 22:59
@torrybr torrybr force-pushed the feat/subscribe-beacons branch 2 times, most recently from e21d9fb to 05c1172 Compare November 15, 2024 00:20
@Hywan
Copy link
Copy Markdown
Member

Hywan commented Nov 19, 2024

See torrybr#1, which does most of the job.

@torrybr torrybr force-pushed the feat/subscribe-beacons branch from 488fb53 to 5bea9ef Compare November 20, 2024 21:30
@torrybr
Copy link
Copy Markdown
Contributor Author

torrybr commented Nov 20, 2024

Updated and rebased with the newest approach for using an observable stream. Appreciate the help and discussion around this PR, thanks!

@torrybr torrybr force-pushed the feat/subscribe-beacons branch 2 times, most recently from feea74e to 7328083 Compare November 21, 2024 03:06
Copy link
Copy Markdown
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Almost there! The code is good, just a comment about documentation.

@torrybr torrybr force-pushed the feat/subscribe-beacons branch from 973e277 to e10d8eb Compare November 27, 2024 12:53
@torrybr torrybr requested a review from Hywan November 27, 2024 12:53
@Hywan Hywan merged commit 3bd57d4 into matrix-org:main Dec 9, 2024
@torrybr torrybr deleted the feat/subscribe-beacons branch February 15, 2025 04:23
stefanceriu pushed a commit that referenced this pull request Jan 22, 2026
This field was added already unused in the initial PR
#3741 for live
location sharing.

The follow up live location PRs didn't make use of it either:

- #3771
- #3794
- #4025

Signed-off-by: Kévin Commaille <[email protected]>
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.

3 participants