@@ -3,7 +3,8 @@ use std::time::Duration;
33use futures_util:: { FutureExt , StreamExt as _, pin_mut} ;
44use js_int:: uint;
55use matrix_sdk:: {
6- assert_let_timeout, live_location_share:: LiveLocationShare , test_utils:: mocks:: MatrixMockServer ,
6+ assert_let_timeout, live_locations_observer:: LiveLocationShare ,
7+ test_utils:: mocks:: MatrixMockServer ,
78} ;
89use matrix_sdk_test:: {
910 DEFAULT_TEST_ROOM_ID , JoinedRoomBuilder , async_test, event_factory:: EventFactory ,
@@ -179,8 +180,8 @@ async fn test_most_recent_event_in_stream() {
179180
180181 // Create the stream after syncing all beacon events — the initial snapshot is
181182 // loaded from the event cache and already reflects the latest beacon.
182- let live_location_shares = room. live_location_shares ( ) . await ;
183- let ( mut shares, _stream) = live_location_shares . subscribe ( ) ;
183+ let live_locations_observer = room. live_locations_observer ( ) . await ;
184+ let ( mut shares, _stream) = live_locations_observer . subscribe ( ) ;
184185
185186 assert_eq ! ( shares. len( ) , 1 ) ;
186187 let LiveLocationShare { user_id, last_location, beacon_info, .. } = shares. remove ( 0 ) ;
@@ -233,8 +234,8 @@ async fn test_observe_single_live_location_share() {
233234 . await ;
234235
235236 let room = client. get_room ( * DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
236- let live_location_shares = room. live_location_shares ( ) . await ;
237- let ( initial, stream) = live_location_shares . subscribe ( ) ;
237+ let live_locations_observer = room. live_locations_observer ( ) . await ;
238+ let ( initial, stream) = live_locations_observer . subscribe ( ) ;
238239 pin_mut ! ( stream) ;
239240
240241 // Initial snapshot contains the beacon_info from state (no last_location yet).
@@ -299,8 +300,8 @@ async fn test_observing_live_location_does_not_return_non_live() {
299300 . await ;
300301
301302 let room = client. get_room ( * DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
302- let live_location_shares = room. live_location_shares ( ) . await ;
303- let ( initial, stream) = live_location_shares . subscribe ( ) ;
303+ let live_locations_observer = room. live_locations_observer ( ) . await ;
304+ let ( initial, stream) = live_locations_observer . subscribe ( ) ;
304305 pin_mut ! ( stream) ;
305306
306307 // Initial is empty because beacon_info is not live.
@@ -352,8 +353,8 @@ async fn test_location_update_for_already_tracked_user() {
352353 . await ;
353354
354355 let room = client. get_room ( * DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
355- let live_location_shares = room. live_location_shares ( ) . await ;
356- let ( initial, stream) = live_location_shares . subscribe ( ) ;
356+ let live_locations_observer = room. live_locations_observer ( ) . await ;
357+ let ( initial, stream) = live_locations_observer . subscribe ( ) ;
357358 pin_mut ! ( stream) ;
358359
359360 // Initial snapshot contains the beacon_info from state (no last_location yet).
@@ -438,8 +439,8 @@ async fn test_beacon_info_stop_removes_user_from_stream() {
438439 . await ;
439440
440441 let room = client. get_room ( * DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
441- let live_location_shares = room. live_location_shares ( ) . await ;
442- let ( initial, stream) = live_location_shares . subscribe ( ) ;
442+ let live_locations_observer = room. live_locations_observer ( ) . await ;
443+ let ( initial, stream) = live_locations_observer . subscribe ( ) ;
443444 pin_mut ! ( stream) ;
444445
445446 // Initial snapshot contains the beacon_info from state (no last_location yet).
@@ -502,8 +503,8 @@ async fn test_multiple_users_in_stream() {
502503 . await ;
503504
504505 let room = client. get_room ( * DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
505- let live_location_shares = room. live_location_shares ( ) . await ;
506- let ( initial, stream) = live_location_shares . subscribe ( ) ;
506+ let live_locations_observer = room. live_locations_observer ( ) . await ;
507+ let ( initial, stream) = live_locations_observer . subscribe ( ) ;
507508 pin_mut ! ( stream) ;
508509
509510 // Initial snapshot contains both alice and bob beacon_infos from state.
@@ -614,8 +615,8 @@ async fn test_initial_load_contains_location_from_event_cache() {
614615 assert_let_timeout ! ( Ok ( _) = event_cache_updates_stream. recv( ) ) ;
615616
616617 let room = client. get_room ( * DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
617- let live_location_shares = room. live_location_shares ( ) . await ;
618- let ( initial, _stream) = live_location_shares . subscribe ( ) ;
618+ let live_locations_observer = room. live_locations_observer ( ) . await ;
619+ let ( initial, _stream) = live_locations_observer . subscribe ( ) ;
619620
620621 // Initial snapshot should contain both beacon_info AND last_location.
621622 assert_eq ! ( initial. len( ) , 1 ) ;
0 commit comments