qri-io / qri

you're invited to a data party!
https://qri.io
GNU General Public License v3.0
1.1k stars 66 forks source link

fix(lib): scope the `lib.apply` context #1930

Closed ramfox closed 2 years ago

ramfox commented 2 years ago

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.