File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
packages/web/src/worker/sync Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -164,15 +164,15 @@ export class SharedSyncImplementation
164164 }
165165
166166 async waitForStatus ( status : SyncStatusOptions ) : Promise < void > {
167- await this . waitForReady ( ) ;
168- // TODO
169- return this . connectionManager . syncStreamImplementation ! . waitForStatus ( status ) ;
167+ return this . withSyncImplementation ( async ( sync ) => {
168+ return sync . waitForStatus ( status ) ;
169+ } ) ;
170170 }
171171
172172 async waitUntilStatusMatches ( predicate : ( status : SyncStatus ) => boolean ) : Promise < void > {
173- await this . waitForReady ( ) ;
174- // TODO
175- return this . connectionManager . syncStreamImplementation ! . waitUntilStatusMatches ( predicate ) ;
173+ return this . withSyncImplementation ( async ( sync ) => {
174+ return sync . waitUntilStatusMatches ( predicate ) ;
175+ } ) ;
176176 }
177177
178178 async waitForReady ( ) {
@@ -455,6 +455,13 @@ export class SharedSyncImplementation
455455 * sync stream client and all tab client's sync status
456456 */
457457 private _testUpdateAllStatuses ( status : SyncStatusOptions ) {
458+ if ( ! this . connectionManager . syncStreamImplementation ) {
459+ // This is just for testing purposes
460+ this . connectionManager . syncStreamImplementation = this . generateStreamingImplementation ( ) ;
461+ }
462+
463+ // Only assigning, don't call listeners for this test
464+ this . connectionManager . syncStreamImplementation ! . syncStatus = new SyncStatus ( status ) ;
458465 this . updateAllStatuses ( status ) ;
459466 }
460467}
You can’t perform that action at this time.
0 commit comments