reactronic 0.21.600 → 0.21.601
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.
|
@@ -483,21 +483,26 @@ class Operation extends Data_1.Observable {
|
|
|
483
483
|
static revokeAllSubscriptions(snapshot) {
|
|
484
484
|
snapshot.changeset.forEach((r, h) => r.changes.forEach((o, m) => Operation.propagateMemberChangeThroughSubscriptions(true, snapshot.timestamp, r, m, h, undefined)));
|
|
485
485
|
}
|
|
486
|
-
static propagateMemberChangeThroughSubscriptions(
|
|
486
|
+
static propagateMemberChangeThroughSubscriptions(unsubscribe, timestamp, r, m, h, reactions) {
|
|
487
487
|
var _a;
|
|
488
|
+
const curr = r.data[m];
|
|
488
489
|
if (reactions) {
|
|
489
490
|
const prev = r.prev.revision.data[m];
|
|
490
491
|
if (prev !== undefined && prev instanceof Data_1.Observable) {
|
|
491
492
|
const cause = { revision: r, memberName: m, usageCount: 0 };
|
|
492
|
-
if (prev instanceof Operation
|
|
493
|
-
prev.
|
|
494
|
-
|
|
495
|
-
|
|
493
|
+
if (prev instanceof Operation) {
|
|
494
|
+
if ((prev.obsoleteSince === Snapshot_1.MAX_TIMESTAMP || prev.obsoleteSince <= 0)) {
|
|
495
|
+
prev.obsoleteDueTo = cause;
|
|
496
|
+
prev.obsoleteSince = timestamp;
|
|
497
|
+
prev.unsubscribeFromAllObservables();
|
|
498
|
+
}
|
|
499
|
+
const opponent = prev.successor;
|
|
500
|
+
if (opponent !== curr && opponent && !opponent.transaction.isFinished)
|
|
501
|
+
opponent.transaction.cancel(new Error(`T${opponent.transaction.id}[${opponent.transaction.hint}] is canceled by T${r.snapshot.id}[${r.snapshot.hint}] and will not run anymore`), null);
|
|
496
502
|
}
|
|
497
503
|
(_a = prev.observers) === null || _a === void 0 ? void 0 : _a.forEach(c => c.markObsoleteDueTo(prev, cause, timestamp, reactions));
|
|
498
504
|
}
|
|
499
505
|
}
|
|
500
|
-
const curr = r.data[m];
|
|
501
506
|
if (curr instanceof Operation) {
|
|
502
507
|
if (curr.revision === r && curr.observables !== undefined) {
|
|
503
508
|
if (Hooks_1.Hooks.repetitiveUsageWarningThreshold < Number.MAX_SAFE_INTEGER) {
|
|
@@ -506,7 +511,7 @@ class Operation extends Data_1.Observable {
|
|
|
506
511
|
Dbg_1.Dbg.log('', '[!]', `${curr.hint()} uses ${Snapshot_1.Dump.rev(hint.revision, hint.memberName)} ${hint.usageCount} times (consider remembering it in a local variable)`, 0, ' *** WARNING ***');
|
|
507
512
|
});
|
|
508
513
|
}
|
|
509
|
-
if (
|
|
514
|
+
if (unsubscribe)
|
|
510
515
|
curr.unsubscribeFromAllObservables();
|
|
511
516
|
}
|
|
512
517
|
}
|