@workglow/task-graph 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -3571,13 +3571,22 @@ class GraphAsTask extends Task {
3571
3571
  this.emitEntitlementChange();
3572
3572
  }
3573
3573
  _entitlementUnsub;
3574
+ _subscribingEntitlements = false;
3574
3575
  _subscribeToSubGraphEntitlements(graph) {
3575
3576
  this._entitlementUnsub?.();
3576
- this._entitlementUnsub = graph.subscribeToTaskEntitlements(() => {
3577
- this.emitEntitlementChange();
3578
- });
3577
+ this._entitlementUnsub = undefined;
3578
+ this._subscribingEntitlements = true;
3579
+ try {
3580
+ this._entitlementUnsub = graph.subscribeToTaskEntitlements(() => {
3581
+ this.emitEntitlementChange();
3582
+ });
3583
+ } finally {
3584
+ this._subscribingEntitlements = false;
3585
+ }
3579
3586
  }
3580
3587
  _syncSubGraphEntitlementSubscription(graph = this._subGraph) {
3588
+ if (this._subscribingEntitlements)
3589
+ return;
3581
3590
  if ((this._events?.listenerCount("entitlementChange") ?? 0) === 0) {
3582
3591
  this._entitlementUnsub?.();
3583
3592
  this._entitlementUnsub = undefined;
@@ -7562,4 +7571,4 @@ export {
7562
7571
  BROWSER_GRANTS
7563
7572
  };
7564
7573
 
7565
- //# debugId=363A2DB42AE51E0764756E2164756E21
7574
+ //# debugId=E394F7013EA0361364756E2164756E21