-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: add transactionAsyncLocalStorage option to opt in to automatically setting session on all transactions #14742
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, though i would recommend to add a note to the documentation that it makes use of a experimental nodejs API below 16.4.0
(as added in the types by me and listed under AsyncLocalStorage
's History).
also i just noticed that option transactionAsyncLocalStorage
(in latest docs) only returns a result for docs/transactions.html
, maybe it should be mentioned as a possible option for mongoose.set
.
aside from that, there are some minor doc suggestions that should be done.
Co-authored-by: hasezoey <hasezoey@gmail.com>
Co-authored-by: hasezoey <hasezoey@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, would wait until #14744 is merged (and included here) before approving
…session option with transactionAsyncLocalStorage; backport #14744
Backport #14583 to 7.x
Re: #13889
Summary
Add
transactionAsyncLocalStorage
option to 7.x. Should work fine because Node v14.x has "experimental" support for the same AsyncLocalStorage API that became stable in 16.x.Examples