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

The return type of connection.tranaction method should not be Promise<void>. #14656

Closed
2 tasks done
LvChengbin opened this issue Jun 9, 2024 · 0 comments · Fixed by #14661
Closed
2 tasks done

The return type of connection.tranaction method should not be Promise<void>. #14656

LvChengbin opened this issue Jun 9, 2024 · 0 comments · Fixed by #14661
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@LvChengbin
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

8.2.4

Node.js version

20.12.2

MongoDB server version

The latest version

Typescript version (if applicable)

5.4.3

Description

transaction(fn: (session: mongodb.ClientSession) => Promise<any>, options?: mongodb.TransactionOptions): Promise<void>;

The return type of method connection.prototype.transaction should not be Promsie<void>.

Steps to Reproduce

.

Expected Behavior

It should use the correct return type.

@IslandRhythms IslandRhythms added the typescript Types or Types-test related issue / Pull Request label Jun 10, 2024
@vkarpov15 vkarpov15 added this to the 8.5 milestone Jun 10, 2024
vkarpov15 added a commit that referenced this issue Jun 11, 2024
types(connection): make transaction() return type match the executor function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants