File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -616,7 +616,12 @@ export class ChangeStream<
616
616
static readonly RESUME_TOKEN_CHANGED = RESUME_TOKEN_CHANGED ;
617
617
618
618
private timeoutContext ?: TimeoutContext ;
619
- private symbol : symbol ;
619
+ /**
620
+ * Note that this property is here to uniquely identify a ChangeStream instance as the owner of
621
+ * the {@link CursorTimeoutContext} instance (see {@link ChangeStream._createChangeStreamCursor}) to ensure
622
+ * that {@link AbstractCursor.close} does not mutate the timeoutContext.
623
+ */
624
+ private contextOwner : symbol ;
620
625
/**
621
626
* @internal
622
627
*
@@ -646,7 +651,7 @@ export class ChangeStream<
646
651
) ;
647
652
}
648
653
649
- this . symbol = Symbol ( ) ;
654
+ this . contextOwner = Symbol ( ) ;
650
655
this . parent = parent ;
651
656
this . namespace = parent . s . namespace ;
652
657
if ( ! this . options . readPreference && parent . readPreference ) {
@@ -905,7 +910,7 @@ export class ChangeStream<
905
910
{
906
911
...options ,
907
912
timeoutContext : this . timeoutContext
908
- ? new CursorTimeoutContext ( this . timeoutContext , this . symbol )
913
+ ? new CursorTimeoutContext ( this . timeoutContext , this . contextOwner )
909
914
: undefined
910
915
}
911
916
) ;
You can’t perform that action at this time.
0 commit comments