Missed this on my first pass because I figured this scoping was taken care of using the newScopeFromWorkflow function. However, this only scopes the scope.Context not the scope.AppContext, which is what we need in lib.apply.
Since the lib.run and lib.apply use the scope for the newScopeFromWorkflow differently, I thought it best to adjust the scoping issue in lib.apply only, rather than newScopeFromWorkflow. If there comes a time when scope.Context() for both workflow runs and workflow applies are both expected to last the context of the app itself, we may want to make this adjustment in newScopeFromWorkflow instead.
Missed this on my first pass because I figured this scoping was taken care of using the
newScopeFromWorkflow
function. However, this only scopes thescope.Context
not thescope.AppContext
, which is what we need inlib.apply
.Since the
lib.run
andlib.apply
use thescope
for thenewScopeFromWorkflow
differently, I thought it best to adjust the scoping issue inlib.apply
only, rather thannewScopeFromWorkflow
. If there comes a time whenscope.Context()
for both workflow runs and workflow applies are both expected to last the context of the app itself, we may want to make this adjustment innewScopeFromWorkflow
instead.