We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc7966c commit 41b1ce3Copy full SHA for 41b1ce3
lib/model.js
@@ -290,9 +290,10 @@ Model.prototype.$__handleSave = function(options, callback) {
290
291
const session = this.$session();
292
const asyncLocalStorage = this[modelDbSymbol].base.transactionAsyncLocalStorage?.getStore();
293
- if (!saveOptions.hasOwnProperty('session') && session != null) {
+ if (session != null) {
294
saveOptions.session = session;
295
} else if (!options.hasOwnProperty('session') && asyncLocalStorage?.session != null) {
296
+ // Only set session from asyncLocalStorage if `session` option wasn't originally passed in options
297
saveOptions.session = asyncLocalStorage.session;
298
}
299
if (this.$isNew) {
0 commit comments