@@ -413,14 +413,14 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
413413 /**
414414 * Commits the currently active transaction in this session.
415415 */
416- async commitTransaction ( ) : Promise < Document > {
416+ async commitTransaction ( ) : Promise < void > {
417417 return endTransactionAsync ( this , 'commitTransaction' ) ;
418418 }
419419
420420 /**
421421 * Aborts the currently active transaction in this session.
422422 */
423- async abortTransaction ( ) : Promise < Document > {
423+ async abortTransaction ( ) : Promise < void > {
424424 return endTransactionAsync ( this , 'abortTransaction' ) ;
425425 }
426426
@@ -636,14 +636,14 @@ const endTransactionAsync = promisify(
636636 endTransaction as (
637637 session : ClientSession ,
638638 commandName : 'abortTransaction' | 'commitTransaction' ,
639- callback : ( error : Error , result : Document ) => void
639+ callback : ( error : Error ) => void
640640 ) => void
641641) ;
642642
643643function endTransaction (
644644 session : ClientSession ,
645645 commandName : 'abortTransaction' | 'commitTransaction' ,
646- callback : Callback < Document >
646+ callback : Callback < void >
647647) {
648648 // handle any initial problematic cases
649649 const txnState = session . transaction . state ;
@@ -717,7 +717,7 @@ function endTransaction(
717717 Object . assign ( command , { maxTimeMS : session . transaction . options . maxTimeMS } ) ;
718718 }
719719
720- function commandHandler ( error ?: Error , result ?: Document ) {
720+ function commandHandler ( error ?: Error ) {
721721 if ( commandName !== 'commitTransaction' ) {
722722 session . transaction . transition ( TxnState . TRANSACTION_ABORTED ) ;
723723 if ( session . loadBalanced ) {
@@ -746,7 +746,7 @@ function endTransaction(
746746 }
747747 }
748748
749- callback ( error , result ) ;
749+ callback ( error ) ;
750750 }
751751
752752 if ( session . transaction . recoveryToken ) {
@@ -761,7 +761,7 @@ function endTransaction(
761761 readPreference : ReadPreference . primary ,
762762 bypassPinningCheck : true
763763 } ) ,
764- ( error , result ) => {
764+ error => {
765765 if ( command . abortTransaction ) {
766766 // always unpin on abort regardless of command outcome
767767 session . unpin ( ) ;
@@ -789,7 +789,7 @@ function endTransaction(
789789 ) ;
790790 }
791791
792- commandHandler ( error , result ) ;
792+ commandHandler ( error ) ;
793793 }
794794 ) ;
795795}
0 commit comments