File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export abstract class AbstractOperation<TResult = any> {
7070 maxAttempts ?: number ;
7171
7272 /** Tracks how many attempts were made in the last executeOperation call. */
73- attemptsMade ? : number ;
73+ attemptsMade : number ;
7474
7575 private _session : ClientSession | undefined ;
7676
@@ -88,6 +88,8 @@ export abstract class AbstractOperation<TResult = any> {
8888
8989 this . options = options ;
9090 this . bypassPinningCheck = ! ! options . bypassPinningCheck ;
91+
92+ this . attemptsMade = 0 ;
9193 }
9294
9395 /** Must match the first key of the command object sent to the server.
Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ export class ClientSession
517517 } catch ( firstCommitError ) {
518518 this . commitAttempted = true ;
519519
520- const remainingAttempts = MAX_RETRIES + 1 - ( operation . attemptsMade ?? 1 ) ;
520+ const remainingAttempts = MAX_RETRIES + 1 - operation . attemptsMade ;
521521 if ( remainingAttempts <= 0 ) {
522522 throw firstCommitError ;
523523 }
You can’t perform that action at this time.
0 commit comments