Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NODE-4961)!: remove command result from commit and abort transaction APIs #3784

Merged
merged 5 commits into from
Jul 31, 2023

Conversation

nbbeeken
Copy link
Contributor

Description

What is changing?

  • commit & abort transaction properly return void
  • added a regression test
Is there new documentation needed for these changes?

The typescript has been updated.

What is the motivation for this change?

See notes

Release Highlight

session.commitTransaction() and session.abortTransaction() return void

Each of these methods erroneously returned server command results that can be different depending on server version or type the driver is connected to. These methods return a promise that if resolved means the command (aborting or commiting) sucessfully completed and rejects otherwise. Viewing command responses is possible through the command monitoring APIs on the MongoClient.

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken added the Blocked Blocked on other work label Jul 25, 2023
@nbbeeken
Copy link
Contributor Author

Needs test fixes from #3783, Otherwise ready for review.

@nbbeeken nbbeeken marked this pull request as ready for review July 25, 2023 18:15
@nbbeeken nbbeeken removed the Blocked Blocked on other work label Jul 26, 2023
@nbbeeken
Copy link
Contributor Author

I put fixes to the tests in this PR, they assert void return values for withTransaction which will change to the value of the result of the executor in the other PR. Which ever lands first can easily merge and use the correct assertions.

@baileympearson baileympearson self-assigned this Jul 26, 2023
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jul 26, 2023
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a testing note in the ticket:

  • Regression test

Do we have any tests that confirm these APIs return void (type or integration)?

@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Jul 31, 2023
@baileympearson baileympearson merged commit 71c5936 into main Jul 31, 2023
@baileympearson baileympearson deleted the NODE-4961-commit-abort-return branch July 31, 2023 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants