Skip to content

refactor(NODE-7084): refactor CUD ops to use ModernizedOperation #4610

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

Merged
merged 10 commits into from
Aug 7, 2025

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Aug 4, 2025

Description

What is changing?

The remaining CUD operations now subclass ModernizedOperation.

After implementing this PR, I noticed tests hanging in CI. I modified the leak checker to print which test in particular failed in order to debug the resource leak, and I left the improvements to the leak checker in this PR. The root cause of the leaks was errors thrown during command construction - a connection was never returned to the pool in this scenario.

Additionally, this PR uncovered a bug in the return type inference from executeOperation. Some operation subclasses override the return type of its superclass (ex: DeleteOneOperation returns a DeleteResult, but DeleteOperation returns Document). Before the changes to executeOperation in this PR, there are TS errors in collection.ts because TS infers that the return type of executeOperation is the superclass's return type, not the subclass's.

Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

Fill in title or leave empty for no highlight

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

@baileympearson baileympearson force-pushed the NODE-7084-cud-ops branch 5 times, most recently from ef2dee8 to ab880fd Compare August 6, 2025 20:24
@baileympearson baileympearson marked this pull request as ready for review August 6, 2025 21:36
@baileympearson baileympearson requested a review from a team as a code owner August 6, 2025 21:36
@durran durran self-assigned this Aug 7, 2025
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Aug 7, 2025
@durran durran merged commit 25dd18e into mongodb:main Aug 7, 2025
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants