Methods decorated with @UseCls() (without runOptions) are not called when running inside a parent context.
Fix
This PR prepends the default options to the options passed down to the cls.run(options, callback) function. This way, options.ifNested is always defined (default to inherit), and the callback is always triggered in the switch (options.ifNested) ... case block.
Since @UseCls() calls run with an empty options object: cls.run({}, callback) ; it fixes the issue 👍
Issue
Methods decorated with
@UseCls()
(withoutrunOptions
) are not called when running inside a parent context.Fix
This PR prepends the default options to the options passed down to the
cls.run(options, callback)
function. This way,options.ifNested
is always defined (default toinherit
), and the callback is always triggered in theswitch (options.ifNested) ... case
block.Since
@UseCls()
callsrun
with an empty options object:cls.run({}, callback)
; it fixes the issue 👍