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-4522)!: remove callback support #3499

Merged
merged 37 commits into from
Jan 23, 2023
Merged

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Dec 21, 2022

Description

What is changing?

Warning ATTN Reviewers

  • There's no check / typescript warning that the async keyword has been used. I think we want that to consistently be in place, so take a close look at signatures.

What is the motivation for this change?

Promises provide a consistent way to handle the outcome of an asynchronous operation, unifying the API here to always use the async syntax forces the code to always return a promise so that errors/resolutions are always handled the same way.

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 wip label Dec 21, 2022
@nbbeeken nbbeeken force-pushed the NODE-4522-rm-callbacks branch 2 times, most recently from d58f1c2 to 4ff1759 Compare January 13, 2023 17:22
@nbbeeken nbbeeken force-pushed the NODE-4522-rm-callbacks branch from 4ff1759 to 8cd919d Compare January 19, 2023 23:44
@nbbeeken nbbeeken force-pushed the NODE-4522-rm-callbacks branch from 8cd919d to 217101d Compare January 20, 2023 17:57
src/db.ts Show resolved Hide resolved
src/admin.ts Show resolved Hide resolved
Comment on lines 1177 to 1178
async execute(options?: BulkWriteOptions): Promise<BulkWriteResult> {
options ??= {};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is it better to use default arg or coalesce assignment 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

personal preference is always default arguments? but either is fine. I just prefer not to have to default ourselves - why not let JS do the work for us 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

default arg is cleaner imho, but it honestly doesn't matter as long as we're consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made this consistent in the few places it wasn't

@nbbeeken nbbeeken removed the wip label Jan 20, 2023
@nbbeeken nbbeeken changed the title [WIP] feat(NODE-4522)!: remove callback support feat(NODE-4522)!: remove callback support Jan 20, 2023
@nbbeeken nbbeeken marked this pull request as ready for review January 20, 2023 18:24
@dariakp dariakp added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jan 20, 2023
@dariakp dariakp added the Team Review Needs review from team label Jan 20, 2023
@nbbeeken
Copy link
Contributor Author

nbbeeken commented Jan 21, 2023

our driver CI is "green", however the FLE integration tests that we pull in from the other repo have callback usage in the tests: mongodb/libmongocrypt#539 (this also makes socks-5 coverage fail b/c we test that FLE works through a proxy)

@nbbeeken
Copy link
Contributor Author

nbbeeken commented Jan 23, 2023

etc/notes/CHANGES_5.0.0.md Outdated Show resolved Hide resolved
etc/notes/CHANGES_5.0.0.md Outdated Show resolved Hide resolved
etc/notes/CHANGES_5.0.0.md Outdated Show resolved Hide resolved
src/admin.ts Show resolved Hide resolved
etc/notes/CHANGES_5.0.0.md Show resolved Hide resolved
test/integration/crud/find_cursor_methods.test.js Outdated Show resolved Hide resolved
test/integration/crud/misc_cursors.test.js Outdated Show resolved Hide resolved
nbbeeken and others added 2 commits January 23, 2023 15:24
Co-authored-by: Daria Pardue <daria.pardue@mongodb.com>
@nbbeeken nbbeeken requested a review from dariakp January 23, 2023 20:29
@nbbeeken
Copy link
Contributor Author

dariakp
dariakp previously approved these changes Jan 23, 2023
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