Skip to content

Commit

Permalink
fix: prevent applicaiton deep update propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
seankwarren committed May 12, 2023
1 parent 1b74b4a commit 2c16856
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/subworkflows/subworkflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ export class Subworkflow extends BaseSubworkflow {
// reset units if application name changes
if (this.application.name !== application.name) this.setUnits([]);
this._application = application;
// propagate application changes to all units
this.units.forEach((unit) => {
if (typeof unit.setApplication === "function") {
unit.setApplication(application);
unit.setApplication(application, false);
}
});
this.setProp("application", application.toJSON());
Expand Down
6 changes: 4 additions & 2 deletions src/units/execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ export class ExecutionUnit extends mix(BaseUnit).with(HashedInputArrayMixin) {
return this.input.map((i) => new this.constructor.Template(i));
}

setApplication(application) {
setApplication(application, propagateUpdates = true) {
this._application = application;
this.setProp("application", application.toJSON());
this.setExecutable(this.application.defaultExecutable);
if (propagateUpdates) {
this.setExecutable(this.application.defaultExecutable);
}
}

setExecutable(executable) {
Expand Down

0 comments on commit 2c16856

Please sign in to comment.