File tree Expand file tree Collapse file tree 5 files changed +16
-18
lines changed
crates/matrix-sdk-ui/src/timeline Expand file tree Collapse file tree 5 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ as_variant = "1.2.0"
3333base64 = " 0.22.1"
3434byteorder = " 1.5.0"
3535chrono = " 0.4.38"
36- eyeball = { version = " 0.8.8 " , features = [" tracing" ] }
37- eyeball-im = { version = " 0.6.0 " , features = [" tracing" ] }
38- eyeball-im-util = " 0.8.0 "
36+ eyeball = { path = " ../eyeball/eyeball/ " , features = [" tracing" ] }
37+ eyeball-im = { path = " ../eyeball/eyeball-im " , features = [" tracing" ] }
38+ eyeball-im-util = { path = " ../eyeball/eyeball-im-util " }
3939futures-core = " 0.3.31"
4040futures-executor = " 0.3.21"
4141futures-util = " 0.3.31"
@@ -44,7 +44,7 @@ growable-bloom-filter = "2.1.1"
4444hkdf = " 0.12.4"
4545hmac = " 0.12.1"
4646http = " 1.1.0"
47- imbl = " 4 .0.1 "
47+ imbl = " 3 .0.0 "
4848indexmap = " 2.6.0"
4949insta = { version = " 1.41.1" , features = [" json" ] }
5050itertools = " 0.13.0"
Original file line number Diff line number Diff line change @@ -496,11 +496,15 @@ impl<P: RoomDataProvider> TimelineController<P> {
496496 ( state. items . clone_items ( ) , state. items . subscribe ( ) . into_stream ( ) )
497497 }
498498
499- pub ( super ) async fn subscribe_batched (
499+ pub ( super ) async fn subscribe_batched_and_limited (
500500 & self ,
501501 ) -> ( Vector < Arc < TimelineItem > > , impl Stream < Item = Vec < VectorDiff < Arc < TimelineItem > > > > ) {
502502 let state = self . state . read ( ) . await ;
503- state. items . subscribe ( ) . into_values_and_batched_stream ( )
503+ state
504+ . items
505+ . subscribe ( )
506+ . into_values_and_batched_stream ( )
507+ . dynamic_skip_with_initial_count ( 0 , state. meta . subscriber_skip_count . subscribe ( ) )
504508 }
505509
506510 pub ( super ) async fn subscribe_filter_map < U , F > (
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ impl Timeline {
276276 pub async fn subscribe (
277277 & self ,
278278 ) -> ( Vector < Arc < TimelineItem > > , impl Stream < Item = Vec < VectorDiff < Arc < TimelineItem > > > > ) {
279- let ( items, stream) = self . controller . subscribe_batched ( ) . await ;
279+ let ( items, stream) = self . controller . subscribe_batched_and_limited ( ) . await ;
280280 let stream = WithTimelineDropHandle :: new ( stream, self . drop_handle . clone ( ) ) ;
281281 ( items, stream)
282282 }
Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ async fn test_replace_with_initial_events_when_batched() {
461461 )
462462 . await ;
463463
464- let ( items, mut stream) = timeline. controller . subscribe_batched ( ) . await ;
464+ let ( items, mut stream) = timeline. controller . subscribe_batched_and_limited ( ) . await ;
465465 assert_eq ! ( items. len( ) , 2 ) ;
466466 assert ! ( items[ 0 ] . is_date_divider( ) ) ;
467467 assert_eq ! ( items[ 1 ] . as_event( ) . unwrap( ) . content( ) . as_message( ) . unwrap( ) . body( ) , "hey" ) ;
You can’t perform that action at this time.
0 commit comments