File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -394,9 +394,7 @@ export class FirestoreClient {
394
394
if ( this . clientTerminated ) {
395
395
return ;
396
396
}
397
- this . asyncQueue . enqueueRetryable ( ( ) => {
398
- return this . eventMgr . unlisten ( listener ) ;
399
- } ) ;
397
+ this . asyncQueue . enqueueRetryable ( ( ) => this . eventMgr . unlisten ( listener ) ) ;
400
398
}
401
399
402
400
async getDocumentFromLocalCache (
Original file line number Diff line number Diff line change @@ -410,18 +410,12 @@ abstract class TestRunner {
410
410
const eventEmitter = this . queryListeners . get ( query ) ;
411
411
debugAssert ( ! ! eventEmitter , 'There must be a query to unlisten too!' ) ;
412
412
413
+ this . queryListeners . delete ( query ) ;
414
+
413
415
const deferred = new Deferred < void > ( ) ;
414
416
await this . queue . enqueueRetryable ( async ( ) => {
415
417
try {
416
418
await this . eventManager . unlisten ( eventEmitter ! ) ;
417
- const currentEventEmitter = this . queryListeners . get ( query ) ;
418
- // Before removing the listener, verify that the query hasn't been
419
- // relistened to in between retry events. We only remove the listener
420
- // if the current event emitter still matches the event emitter at the
421
- // time of the unlisten.
422
- if ( currentEventEmitter === eventEmitter ) {
423
- this . queryListeners . delete ( query ) ;
424
- }
425
419
} catch ( e ) {
426
420
expect ( this . persistence . injectFailures ) . contains ( 'Release target' ) ;
427
421
throw e ;
You can’t perform that action at this time.
0 commit comments