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

fix(shell-api): don't pass options into cursor.close() MONGOSH-1356 #1379

Merged

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Jan 5, 2023

Here's a patch from the driver running against the changes in this branch:

https://spruce.mongodb.com/version/63b7157961837d672d740cca/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

@@ -53,8 +53,8 @@ export abstract class AbstractCursor<CursorType extends ServiceProviderAggregati
}

@returnsPromise
async close(options: Document = {}): Promise<void> {
await this._cursor.close(options);
async close(): Promise<void> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure if this was okay (I'm not sure if this method gets exposed). If we need to preserve the method signature, I can skip the "no unused vars" lint rule for this line.

Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking maybe for users who are executing scripts with the shell this is exposed and options are potentially being passed in even if a no-op. Maybe safer to leave with the lint rule skipping. Thoughts @addaleax ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Mh yeah … I guess this would be an issue only if we ever would decide to reintroduce an argument for this function (with possibly different semantics), but that seems very unlikely? I think this is fine as it is, tbh.

@addaleax addaleax changed the title fix(MONGOSH-1356): don't pass options into cursor.close() fix(shell-api): don't pass options into cursor.close() MONGOSH-1356 Jan 6, 2023
@baileympearson baileympearson merged commit f546c4f into mongodb-js:main Jan 6, 2023
@baileympearson baileympearson deleted the MONGOSH-1356-cursor-close branch January 6, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants