@@ -2,6 +2,7 @@ import type Owner from '@ember/owner';
2
2
import type RouterService from '@ember/routing/router-service' ;
3
3
import { debounce } from '@ember/runloop' ;
4
4
import Service , { service } from '@ember/service' ;
5
+ import { buildWaiter } from '@ember/test-waiters' ;
5
6
import { cached , tracked } from '@glimmer/tracking' ;
6
7
7
8
import { restartableTask , task } from 'ember-concurrency' ;
@@ -122,6 +123,7 @@ const SLIDING_SYNC_LIST_RANGE_SIZE = 10;
122
123
const SLIDING_SYNC_LIST_TIMELINE_LIMIT = 1 ;
123
124
124
125
const realmEventsLogger = logger ( 'realm:events' ) ;
126
+ const waiter = buildWaiter ( 'matrix-service:waiter' ) ;
125
127
126
128
export type OperatorModeContext = {
127
129
submode : Submode ;
@@ -1181,6 +1183,7 @@ export default class MatrixService extends Service {
1181
1183
}
1182
1184
1183
1185
this . timelineLoadingState . set ( roomId , true ) ;
1186
+ let token = waiter . beginAsync ( ) ;
1184
1187
try {
1185
1188
while ( room . oldState . paginationToken != null ) {
1186
1189
await this . client . scrollback ( room ) ;
@@ -1209,6 +1212,7 @@ export default class MatrixService extends Service {
1209
1212
} ) ;
1210
1213
} finally {
1211
1214
this . timelineLoadingState . set ( roomId , false ) ;
1215
+ waiter . endAsync ( token ) ;
1212
1216
}
1213
1217
} ) ;
1214
1218
0 commit comments