From 0db289fa80f2c3cfa7192a707fb7cc2af6210508 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 14 Apr 2026 14:02:09 +0200 Subject: [PATCH 1/4] chore: rename LiveLocationShares to RoomLiveLocationService --- .../matrix-sdk-ffi/src/live_location_share.rs | 18 +++++++++--------- bindings/matrix-sdk-ffi/src/room/mod.rs | 10 +++++----- crates/matrix-sdk/src/live_location_share.rs | 8 ++++---- crates/matrix-sdk/src/room/mod.rs | 10 +++++----- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/live_location_share.rs b/bindings/matrix-sdk-ffi/src/live_location_share.rs index e2b8ba1f8aa..1fdacff4500 100644 --- a/bindings/matrix-sdk-ffi/src/live_location_share.rs +++ b/bindings/matrix-sdk-ffi/src/live_location_share.rs @@ -17,7 +17,7 @@ use std::{fmt::Debug, sync::Arc}; use eyeball_im::VectorDiff; use futures_util::StreamExt as _; use matrix_sdk::live_location_share::{ - LiveLocationShare as SdkLiveLocationShare, LiveLocationShares as SdkLiveLocationShares, + LiveLocationShare as SdkLiveLocationShare, RoomLiveLocationService as SdkRoomLiveLocationService, }; use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm}; @@ -76,22 +76,22 @@ pub trait LiveLocationShareListener: SendOutsideWasm + SyncOutsideWasm + Debug { /// Tracks active live location shares in a room. /// -/// Holds the SDK [`SdkLiveLocationShares`] which keeps the beacon and +/// Holds the SDK [`SdkRoomLiveLocationService`] which keeps the beacon and /// beacon_info event handlers registered for as long as this object is alive. -/// Call [`LiveLocationShares::subscribe`] to start receiving updates. +/// Call [`RoomLiveLocationService::subscribe`] to start receiving updates. #[derive(uniffi::Object)] -pub struct LiveLocationShares { - inner: SdkLiveLocationShares, +pub struct RoomLiveLocationService { + inner: SdkRoomLiveLocationService, } -impl LiveLocationShares { - pub fn new(inner: SdkLiveLocationShares) -> Self { +impl RoomLiveLocationService { + pub fn new(inner: SdkRoomLiveLocationService) -> Self { Self { inner } } } #[matrix_sdk_ffi_macros::export] -impl LiveLocationShares { +impl RoomLiveLocationService { /// Subscribe to changes in the list of active live location shares. /// /// Immediately calls `listener` with a `Reset` update containing the @@ -100,7 +100,7 @@ impl LiveLocationShares { /// /// Returns a [`TaskHandle`] that, when dropped, stops the listener. /// The event handlers remain registered for as long as this - /// [`LiveLocationShares`] object is alive. + /// [`RoomLiveLocationService`] object is alive. pub fn subscribe(&self, listener: Box) -> Arc { let (initial_values, mut stream) = self.inner.subscribe(); diff --git a/bindings/matrix-sdk-ffi/src/room/mod.rs b/bindings/matrix-sdk-ffi/src/room/mod.rs index 48d0e132f3a..d0416bc82d1 100644 --- a/bindings/matrix-sdk-ffi/src/room/mod.rs +++ b/bindings/matrix-sdk-ffi/src/room/mod.rs @@ -56,7 +56,7 @@ use crate::{ error::{ClientError, MediaInfoError, NotYetImplemented, QueueWedgeError, RoomError}, event::TimelineEvent, identity_status_change::IdentityStatusChange, - live_location_share::LiveLocationShares, + live_location_share::RoomLiveLocationService, room_member::{RoomMember, RoomMemberWithSenderInfo}, room_preview::RoomPreview, ruma::{AudioInfo, FileInfo, ImageInfo, MediaSource, ThumbnailInfo, VideoInfo}, @@ -1138,14 +1138,14 @@ impl Room { /// Returns the active live location shares for this room. /// - /// The returned [`LiveLocationShares`] object tracks which users are + /// The returned [`RoomLiveLocationService`] object tracks which users are /// currently sharing their live location. It keeps the underlying event /// handlers registered — and therefore the share list up-to-date — for as - /// long as it is alive. Call [`LiveLocationShares::subscribe`] on it to + /// long as it is alive. Call [`RoomLiveLocationService::subscribe`] on it to /// receive an initial snapshot and a stream of incremental updates. - pub async fn live_location_shares(&self) -> Arc { + pub async fn live_location_shares(&self) -> Arc { let inner = self.inner.live_location_shares().await; - Arc::new(LiveLocationShares::new(inner)) + Arc::new(RoomLiveLocationService::new(inner)) } /// Forget this room. diff --git a/crates/matrix-sdk/src/live_location_share.rs b/crates/matrix-sdk/src/live_location_share.rs index 459549f197f..d06eb1752ef 100644 --- a/crates/matrix-sdk/src/live_location_share.rs +++ b/crates/matrix-sdk/src/live_location_share.rs @@ -63,18 +63,18 @@ pub struct LiveLocationShare { /// /// Registers event handlers for beacon (location update) and beacon info /// (share started/stopped) events and reflects changes into a vector that -/// callers can subscribe to via [`LiveLocationShares::subscribe`]. +/// callers can subscribe to via [`RoomLiveLocationService::subscribe`]. /// /// Event handlers are automatically unregistered when this struct is dropped. #[derive(Debug)] -pub struct LiveLocationShares { +pub struct RoomLiveLocationService { shares: Arc>>, _beacon_guard: EventHandlerDropGuard, _beacon_info_guard: EventHandlerDropGuard, } -impl LiveLocationShares { - /// Create a new [`LiveLocationShares`] for the given room. +impl RoomLiveLocationService { + /// Create a new [`RoomLiveLocationService`] for the given room. /// /// Loads the current active shares from the event cache as initial state, /// then begins listening for beacon events to keep the vector up-to-date. diff --git a/crates/matrix-sdk/src/room/mod.rs b/crates/matrix-sdk/src/room/mod.rs index d4389effc4a..c8f7a493dd2 100644 --- a/crates/matrix-sdk/src/room/mod.rs +++ b/crates/matrix-sdk/src/room/mod.rs @@ -181,7 +181,7 @@ use crate::{ error::{BeaconError, WrongRoomState}, event_cache::{self, EventCacheDropHandles, RoomEventCache}, event_handler::{EventHandler, EventHandlerDropGuard, EventHandlerHandle, SyncEvent}, - live_location_share::LiveLocationShares, + live_location_share::RoomLiveLocationService, media::{MediaFormat, MediaRequestParameters}, notification_settings::{IsEncrypted, IsOneToOne, RoomNotificationMode}, room::{ @@ -719,13 +719,13 @@ impl Room { /// Subscribes to active live location shares in this room. /// - /// Returns a [`LiveLocationShares`] that holds the current state and + /// Returns a [`RoomLiveLocationService`] that holds the current state and /// exposes a stream of incremental [`eyeball_im::VectorDiff`] updates via - /// [`LiveLocationShares::subscribe`]. + /// [`RoomLiveLocationService::subscribe`]. /// /// Event handlers are active for as long as the returned struct is alive. - pub async fn live_location_shares(&self) -> LiveLocationShares { - LiveLocationShares::new(self.clone()).await + pub async fn live_location_shares(&self) -> RoomLiveLocationService { + RoomLiveLocationService::new(self.clone()).await } /// Returns a wrapping `TimelineEvent` for the input `AnyTimelineEvent`, From 1ee0aebe1ad8d91d5c29735ca4218c67d265a69e Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 14 Apr 2026 14:18:44 +0200 Subject: [PATCH 2/4] docs: changelog --- bindings/matrix-sdk-ffi/CHANGELOG.md | 4 +++- crates/matrix-sdk/CHANGELOG.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/matrix-sdk-ffi/CHANGELOG.md b/bindings/matrix-sdk-ffi/CHANGELOG.md index e79a67f29c6..e068f08a8af 100644 --- a/bindings/matrix-sdk-ffi/CHANGELOG.md +++ b/bindings/matrix-sdk-ffi/CHANGELOG.md @@ -147,8 +147,10 @@ All notable changes to this project will be documented in this file. ### Refactor +- [**breaking**] `LiveLocationShares` has been renamed to `RoomLiveLocationService`. + ([#6446](https://github.com/matrix-org/matrix-rust-sdk/pull/6446)) - [**breaking**] `Room::observe_live_location_shares` has been replaced by - `Room::live_location_shares`. Call [`LiveLocationShares::subscribe`] on it to + `Room::live_location_shares`. Call [`RoomLiveLocationService::subscribe`] on it to receive an initial snapshot and a stream of incremental updates.The stream is seeded from the event cache on creation and includes the own user's shares (previously excluded). `LiveLocationShare.is_live` has been removed; instead `ts` (start timestamp) and `timeout` (duration in milliseconds) are now diff --git a/crates/matrix-sdk/CHANGELOG.md b/crates/matrix-sdk/CHANGELOG.md index 82eee9a18d4..39cb1375529 100644 --- a/crates/matrix-sdk/CHANGELOG.md +++ b/crates/matrix-sdk/CHANGELOG.md @@ -113,6 +113,9 @@ All notable changes to this project will be documented in this file. ### Breaking Changes +- [**breaking**] `LiveLocationShares` has been renamed to `RoomLiveLocationService`. + ([#6446](https://github.com/matrix-org/matrix-rust-sdk/pull/6446)) + - `Room::observe_live_location_shares` has been replaced by `Room::live_location_shares`. The new API returns a `LiveLocationShares` struct with a `subscribe()` method that provides an initial snapshot (`Vector`) and a batched stream of `VectorDiff` updates, instead of From 60d5a3823b62d6decf0b89144cae8df687da4862 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 14 Apr 2026 15:16:44 +0200 Subject: [PATCH 3/4] change: renamed to LiveLocationsObserver --- bindings/matrix-sdk-ffi/CHANGELOG.md | 5 +++-- .../matrix-sdk-ffi/src/live_location_share.rs | 18 +++++++++--------- bindings/matrix-sdk-ffi/src/room/mod.rs | 12 ++++++------ crates/matrix-sdk/CHANGELOG.md | 7 ++++--- crates/matrix-sdk/src/live_location_share.rs | 8 ++++---- crates/matrix-sdk/src/room/mod.rs | 10 +++++----- .../tests/integration/room/beacon/mod.rs | 14 +++++++------- 7 files changed, 38 insertions(+), 36 deletions(-) diff --git a/bindings/matrix-sdk-ffi/CHANGELOG.md b/bindings/matrix-sdk-ffi/CHANGELOG.md index e068f08a8af..7cde66a9ffe 100644 --- a/bindings/matrix-sdk-ffi/CHANGELOG.md +++ b/bindings/matrix-sdk-ffi/CHANGELOG.md @@ -147,10 +147,11 @@ All notable changes to this project will be documented in this file. ### Refactor -- [**breaking**] `LiveLocationShares` has been renamed to `RoomLiveLocationService`. +- [**breaking**] `LiveLocationShares` has been renamed to `LiveLocationsObserver` and + `Room::live_location_shares` to `Room::live_locations_observer`. ([#6446](https://github.com/matrix-org/matrix-rust-sdk/pull/6446)) - [**breaking**] `Room::observe_live_location_shares` has been replaced by - `Room::live_location_shares`. Call [`RoomLiveLocationService::subscribe`] on it to + `Room::live_locations_observer`. Call [`LiveLocationsObserver::subscribe`] on it to receive an initial snapshot and a stream of incremental updates.The stream is seeded from the event cache on creation and includes the own user's shares (previously excluded). `LiveLocationShare.is_live` has been removed; instead `ts` (start timestamp) and `timeout` (duration in milliseconds) are now diff --git a/bindings/matrix-sdk-ffi/src/live_location_share.rs b/bindings/matrix-sdk-ffi/src/live_location_share.rs index 1fdacff4500..4882dc20126 100644 --- a/bindings/matrix-sdk-ffi/src/live_location_share.rs +++ b/bindings/matrix-sdk-ffi/src/live_location_share.rs @@ -17,7 +17,7 @@ use std::{fmt::Debug, sync::Arc}; use eyeball_im::VectorDiff; use futures_util::StreamExt as _; use matrix_sdk::live_location_share::{ - LiveLocationShare as SdkLiveLocationShare, RoomLiveLocationService as SdkRoomLiveLocationService, + LiveLocationShare as SdkLiveLocationShare, LiveLocationsObserver as SdkLiveLocationsObserver, }; use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm}; @@ -76,22 +76,22 @@ pub trait LiveLocationShareListener: SendOutsideWasm + SyncOutsideWasm + Debug { /// Tracks active live location shares in a room. /// -/// Holds the SDK [`SdkRoomLiveLocationService`] which keeps the beacon and +/// Holds the SDK [`SdkLiveLocationsObserver`] which keeps the beacon and /// beacon_info event handlers registered for as long as this object is alive. -/// Call [`RoomLiveLocationService::subscribe`] to start receiving updates. +/// Call [`LiveLocationsObserver::subscribe`] to start receiving updates. #[derive(uniffi::Object)] -pub struct RoomLiveLocationService { - inner: SdkRoomLiveLocationService, +pub struct LiveLocationsObserver { + inner: SdkLiveLocationsObserver, } -impl RoomLiveLocationService { - pub fn new(inner: SdkRoomLiveLocationService) -> Self { +impl LiveLocationsObserver { + pub fn new(inner: SdkLiveLocationsObserver) -> Self { Self { inner } } } #[matrix_sdk_ffi_macros::export] -impl RoomLiveLocationService { +impl LiveLocationsObserver { /// Subscribe to changes in the list of active live location shares. /// /// Immediately calls `listener` with a `Reset` update containing the @@ -100,7 +100,7 @@ impl RoomLiveLocationService { /// /// Returns a [`TaskHandle`] that, when dropped, stops the listener. /// The event handlers remain registered for as long as this - /// [`RoomLiveLocationService`] object is alive. + /// [`LiveLocationsObserver`] object is alive. pub fn subscribe(&self, listener: Box) -> Arc { let (initial_values, mut stream) = self.inner.subscribe(); diff --git a/bindings/matrix-sdk-ffi/src/room/mod.rs b/bindings/matrix-sdk-ffi/src/room/mod.rs index d0416bc82d1..23f795d871f 100644 --- a/bindings/matrix-sdk-ffi/src/room/mod.rs +++ b/bindings/matrix-sdk-ffi/src/room/mod.rs @@ -56,7 +56,7 @@ use crate::{ error::{ClientError, MediaInfoError, NotYetImplemented, QueueWedgeError, RoomError}, event::TimelineEvent, identity_status_change::IdentityStatusChange, - live_location_share::RoomLiveLocationService, + live_location_share::LiveLocationsObserver, room_member::{RoomMember, RoomMemberWithSenderInfo}, room_preview::RoomPreview, ruma::{AudioInfo, FileInfo, ImageInfo, MediaSource, ThumbnailInfo, VideoInfo}, @@ -1138,14 +1138,14 @@ impl Room { /// Returns the active live location shares for this room. /// - /// The returned [`RoomLiveLocationService`] object tracks which users are + /// The returned [`LiveLocationsObserver`] object tracks which users are /// currently sharing their live location. It keeps the underlying event /// handlers registered — and therefore the share list up-to-date — for as - /// long as it is alive. Call [`RoomLiveLocationService::subscribe`] on it to + /// long as it is alive. Call [`LiveLocationsObserver::subscribe`] on it to /// receive an initial snapshot and a stream of incremental updates. - pub async fn live_location_shares(&self) -> Arc { - let inner = self.inner.live_location_shares().await; - Arc::new(RoomLiveLocationService::new(inner)) + pub async fn live_locations_observer(&self) -> Arc { + let inner = self.inner.live_locations_observer().await; + Arc::new(LiveLocationsObserver::new(inner)) } /// Forget this room. diff --git a/crates/matrix-sdk/CHANGELOG.md b/crates/matrix-sdk/CHANGELOG.md index 39cb1375529..42dd7d42dd4 100644 --- a/crates/matrix-sdk/CHANGELOG.md +++ b/crates/matrix-sdk/CHANGELOG.md @@ -113,11 +113,12 @@ All notable changes to this project will be documented in this file. ### Breaking Changes -- [**breaking**] `LiveLocationShares` has been renamed to `RoomLiveLocationService`. +- [**breaking**] `LiveLocationShares` has been renamed to `LiveLocationsObserver` and + `Room::live_location_shares` to `Room::live_locations_observer`. ([#6446](https://github.com/matrix-org/matrix-rust-sdk/pull/6446)) -- `Room::observe_live_location_shares` has been replaced by `Room::live_location_shares`. - The new API returns a `LiveLocationShares` struct with a `subscribe()` method that provides an initial +- `Room::observe_live_location_shares` has been replaced by `Room::live_locations_observer`. + The new API returns a `LiveLocationsObserver` struct with a `subscribe()` method that provides an initial snapshot (`Vector`) and a batched stream of `VectorDiff` updates, instead of emitting individual `LiveLocationShare` items as beacon events arrive. The initial snapshot is loaded from the event cache on creation, includes the own user's shares (previously excluded), and properly diff --git a/crates/matrix-sdk/src/live_location_share.rs b/crates/matrix-sdk/src/live_location_share.rs index d06eb1752ef..b7287735c21 100644 --- a/crates/matrix-sdk/src/live_location_share.rs +++ b/crates/matrix-sdk/src/live_location_share.rs @@ -63,18 +63,18 @@ pub struct LiveLocationShare { /// /// Registers event handlers for beacon (location update) and beacon info /// (share started/stopped) events and reflects changes into a vector that -/// callers can subscribe to via [`RoomLiveLocationService::subscribe`]. +/// callers can subscribe to via [`LiveLocationsObserver::subscribe`]. /// /// Event handlers are automatically unregistered when this struct is dropped. #[derive(Debug)] -pub struct RoomLiveLocationService { +pub struct LiveLocationsObserver { shares: Arc>>, _beacon_guard: EventHandlerDropGuard, _beacon_info_guard: EventHandlerDropGuard, } -impl RoomLiveLocationService { - /// Create a new [`RoomLiveLocationService`] for the given room. +impl LiveLocationsObserver { + /// Create a new [`LiveLocationsObserver`] for the given room. /// /// Loads the current active shares from the event cache as initial state, /// then begins listening for beacon events to keep the vector up-to-date. diff --git a/crates/matrix-sdk/src/room/mod.rs b/crates/matrix-sdk/src/room/mod.rs index c8f7a493dd2..e2c3ea518ba 100644 --- a/crates/matrix-sdk/src/room/mod.rs +++ b/crates/matrix-sdk/src/room/mod.rs @@ -181,7 +181,7 @@ use crate::{ error::{BeaconError, WrongRoomState}, event_cache::{self, EventCacheDropHandles, RoomEventCache}, event_handler::{EventHandler, EventHandlerDropGuard, EventHandlerHandle, SyncEvent}, - live_location_share::RoomLiveLocationService, + live_location_share::LiveLocationsObserver, media::{MediaFormat, MediaRequestParameters}, notification_settings::{IsEncrypted, IsOneToOne, RoomNotificationMode}, room::{ @@ -719,13 +719,13 @@ impl Room { /// Subscribes to active live location shares in this room. /// - /// Returns a [`RoomLiveLocationService`] that holds the current state and + /// Returns a [`LiveLocationsObserver`] that holds the current state and /// exposes a stream of incremental [`eyeball_im::VectorDiff`] updates via - /// [`RoomLiveLocationService::subscribe`]. + /// [`LiveLocationsObserver::subscribe`]. /// /// Event handlers are active for as long as the returned struct is alive. - pub async fn live_location_shares(&self) -> RoomLiveLocationService { - RoomLiveLocationService::new(self.clone()).await + pub async fn live_locations_observer(&self) -> LiveLocationsObserver { + LiveLocationsObserver::new(self.clone()).await } /// Returns a wrapping `TimelineEvent` for the input `AnyTimelineEvent`, diff --git a/crates/matrix-sdk/tests/integration/room/beacon/mod.rs b/crates/matrix-sdk/tests/integration/room/beacon/mod.rs index e4af9f3e154..8c93833a7a8 100644 --- a/crates/matrix-sdk/tests/integration/room/beacon/mod.rs +++ b/crates/matrix-sdk/tests/integration/room/beacon/mod.rs @@ -179,7 +179,7 @@ async fn test_most_recent_event_in_stream() { // Create the stream after syncing all beacon events — the initial snapshot is // loaded from the event cache and already reflects the latest beacon. - let live_location_shares = room.live_location_shares().await; + let live_location_shares = room.live_locations_observer().await; let (mut shares, _stream) = live_location_shares.subscribe(); assert_eq!(shares.len(), 1); @@ -233,7 +233,7 @@ async fn test_observe_single_live_location_share() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_location_shares().await; + let live_location_shares = room.live_locations_observer().await; let (initial, stream) = live_location_shares.subscribe(); pin_mut!(stream); @@ -299,7 +299,7 @@ async fn test_observing_live_location_does_not_return_non_live() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_location_shares().await; + let live_location_shares = room.live_locations_observer().await; let (initial, stream) = live_location_shares.subscribe(); pin_mut!(stream); @@ -352,7 +352,7 @@ async fn test_location_update_for_already_tracked_user() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_location_shares().await; + let live_location_shares = room.live_locations_observer().await; let (initial, stream) = live_location_shares.subscribe(); pin_mut!(stream); @@ -438,7 +438,7 @@ async fn test_beacon_info_stop_removes_user_from_stream() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_location_shares().await; + let live_location_shares = room.live_locations_observer().await; let (initial, stream) = live_location_shares.subscribe(); pin_mut!(stream); @@ -502,7 +502,7 @@ async fn test_multiple_users_in_stream() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_location_shares().await; + let live_location_shares = room.live_locations_observer().await; let (initial, stream) = live_location_shares.subscribe(); pin_mut!(stream); @@ -614,7 +614,7 @@ async fn test_initial_load_contains_location_from_event_cache() { assert_let_timeout!(Ok(_) = event_cache_updates_stream.recv()); let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_location_shares().await; + let live_location_shares = room.live_locations_observer().await; let (initial, _stream) = live_location_shares.subscribe(); // Initial snapshot should contain both beacon_info AND last_location. From 79c2c419673b2d4415e3250be1c89f3f6d2b4ba3 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 16 Apr 2026 10:48:20 +0200 Subject: [PATCH 4/4] chore: rename variables to match live_locations_observer --- .../tests/integration/room/beacon/mod.rs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/matrix-sdk/tests/integration/room/beacon/mod.rs b/crates/matrix-sdk/tests/integration/room/beacon/mod.rs index 8c93833a7a8..6eb4dbd9c8c 100644 --- a/crates/matrix-sdk/tests/integration/room/beacon/mod.rs +++ b/crates/matrix-sdk/tests/integration/room/beacon/mod.rs @@ -179,8 +179,8 @@ async fn test_most_recent_event_in_stream() { // Create the stream after syncing all beacon events — the initial snapshot is // loaded from the event cache and already reflects the latest beacon. - let live_location_shares = room.live_locations_observer().await; - let (mut shares, _stream) = live_location_shares.subscribe(); + let live_locations_observer = room.live_locations_observer().await; + let (mut shares, _stream) = live_locations_observer.subscribe(); assert_eq!(shares.len(), 1); let LiveLocationShare { user_id, last_location, beacon_info, .. } = shares.remove(0); @@ -233,8 +233,8 @@ async fn test_observe_single_live_location_share() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_locations_observer().await; - let (initial, stream) = live_location_shares.subscribe(); + let live_locations_observer = room.live_locations_observer().await; + let (initial, stream) = live_locations_observer.subscribe(); pin_mut!(stream); // Initial snapshot contains the beacon_info from state (no last_location yet). @@ -299,8 +299,8 @@ async fn test_observing_live_location_does_not_return_non_live() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_locations_observer().await; - let (initial, stream) = live_location_shares.subscribe(); + let live_locations_observer = room.live_locations_observer().await; + let (initial, stream) = live_locations_observer.subscribe(); pin_mut!(stream); // Initial is empty because beacon_info is not live. @@ -352,8 +352,8 @@ async fn test_location_update_for_already_tracked_user() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_locations_observer().await; - let (initial, stream) = live_location_shares.subscribe(); + let live_locations_observer = room.live_locations_observer().await; + let (initial, stream) = live_locations_observer.subscribe(); pin_mut!(stream); // Initial snapshot contains the beacon_info from state (no last_location yet). @@ -438,8 +438,8 @@ async fn test_beacon_info_stop_removes_user_from_stream() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_locations_observer().await; - let (initial, stream) = live_location_shares.subscribe(); + let live_locations_observer = room.live_locations_observer().await; + let (initial, stream) = live_locations_observer.subscribe(); pin_mut!(stream); // Initial snapshot contains the beacon_info from state (no last_location yet). @@ -502,8 +502,8 @@ async fn test_multiple_users_in_stream() { .await; let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_locations_observer().await; - let (initial, stream) = live_location_shares.subscribe(); + let live_locations_observer = room.live_locations_observer().await; + let (initial, stream) = live_locations_observer.subscribe(); pin_mut!(stream); // Initial snapshot contains both alice and bob beacon_infos from state. @@ -614,8 +614,8 @@ async fn test_initial_load_contains_location_from_event_cache() { assert_let_timeout!(Ok(_) = event_cache_updates_stream.recv()); let room = client.get_room(*DEFAULT_TEST_ROOM_ID).unwrap(); - let live_location_shares = room.live_locations_observer().await; - let (initial, _stream) = live_location_shares.subscribe(); + let live_locations_observer = room.live_locations_observer().await; + let (initial, _stream) = live_locations_observer.subscribe(); // Initial snapshot should contain both beacon_info AND last_location. assert_eq!(initial.len(), 1);