Skip to content

Commit ccc0094

Browse files
PoC commit 2 - fix failing test
1 parent 4108754 commit ccc0094

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sessions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,11 @@ async function attemptTransactionCommit<T>(
559559
!isMaxTimeMSExpiredError(err)
560560
) {
561561
if (err.hasErrorLabel(MongoErrorLabel.UnknownTransactionCommitResult)) {
562-
return attemptTransactionCommit(session, startTime, fn, result, options);
562+
return await attemptTransactionCommit(session, startTime, fn, result, options);
563563
}
564564

565565
if (err.hasErrorLabel(MongoErrorLabel.TransientTransactionError)) {
566-
return attemptTransaction(session, startTime, fn, options);
566+
return await attemptTransaction(session, startTime, fn, options);
567567
}
568568
}
569569

@@ -660,6 +660,7 @@ async function endTransaction(
660660
if (txnState === TxnState.STARTING_TRANSACTION) {
661661
// the transaction was never started, we can safely exit here
662662
session.transaction.transition(TxnState.TRANSACTION_ABORTED);
663+
return;
663664
}
664665

665666
if (txnState === TxnState.TRANSACTION_ABORTED) {

0 commit comments

Comments
 (0)