reactronic 0.24.303 → 0.24.305
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/build/dist/source/Options.d.ts +1 -0
- package/build/dist/source/core/Mvcc.d.ts +1 -0
- package/build/dist/source/core/Mvcc.js +2 -0
- package/build/dist/source/core/Operation.js +8 -3
- package/build/dist/source/core/RxNode.js +1 -0
- package/build/dist/source/core/Transaction.d.ts +1 -1
- package/build/dist/source/core/Transaction.js +1 -1
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ export type MemberOptions = {
|
|
|
18
18
|
readonly triggeringArgs: boolean;
|
|
19
19
|
readonly throttling: number;
|
|
20
20
|
readonly reentrance: Reentrance;
|
|
21
|
+
readonly allowObsoleteToFinish: boolean;
|
|
21
22
|
readonly journal: Journal | undefined;
|
|
22
23
|
readonly indicator: Indicator | null;
|
|
23
24
|
readonly logging?: Partial<LoggingOptions>;
|
|
@@ -24,6 +24,7 @@ export declare class OptionsImpl implements MemberOptions {
|
|
|
24
24
|
readonly triggeringArgs: boolean;
|
|
25
25
|
readonly throttling: number;
|
|
26
26
|
readonly reentrance: Reentrance;
|
|
27
|
+
readonly allowObsoleteToFinish: boolean;
|
|
27
28
|
readonly journal: Journal | undefined;
|
|
28
29
|
readonly indicator: Indicator | null;
|
|
29
30
|
readonly logging?: Partial<LoggingOptions>;
|
|
@@ -33,6 +33,7 @@ const DEFAULT_OPTIONS = Object.freeze({
|
|
|
33
33
|
triggeringArgs: false,
|
|
34
34
|
throttling: Number.MAX_SAFE_INTEGER,
|
|
35
35
|
reentrance: Reentrance.preventWithError,
|
|
36
|
+
allowObsoleteToFinish: false,
|
|
36
37
|
journal: undefined,
|
|
37
38
|
indicator: null,
|
|
38
39
|
logging: undefined,
|
|
@@ -48,6 +49,7 @@ export class OptionsImpl {
|
|
|
48
49
|
this.triggeringArgs = merge(DEFAULT_OPTIONS.triggeringArgs, existing.triggeringArgs, patch.triggeringArgs, implicit);
|
|
49
50
|
this.throttling = merge(DEFAULT_OPTIONS.throttling, existing.throttling, patch.throttling, implicit);
|
|
50
51
|
this.reentrance = merge(DEFAULT_OPTIONS.reentrance, existing.reentrance, patch.reentrance, implicit);
|
|
52
|
+
this.allowObsoleteToFinish = merge(DEFAULT_OPTIONS.allowObsoleteToFinish, existing.allowObsoleteToFinish, patch.allowObsoleteToFinish, implicit);
|
|
51
53
|
this.journal = merge(DEFAULT_OPTIONS.journal, existing.journal, patch.journal, implicit);
|
|
52
54
|
this.indicator = merge(DEFAULT_OPTIONS.indicator, existing.indicator, patch.indicator, implicit);
|
|
53
55
|
this.logging = merge(DEFAULT_OPTIONS.logging, existing.logging, patch.logging, implicit);
|
|
@@ -189,7 +189,8 @@ export class OperationImpl {
|
|
|
189
189
|
static markObsolete(self) {
|
|
190
190
|
const ror = self.peek(undefined);
|
|
191
191
|
const ctx = ror.changeset;
|
|
192
|
-
ror.launch.
|
|
192
|
+
const obsolete = ror.launch.transaction.isFinished ? ctx.obsolete : ror.launch.transaction.changeset.obsolete;
|
|
193
|
+
ror.launch.markObsoleteDueTo(ror.launch, self.fieldKey, EMPTY_OBJECT_VERSION.changeset, EMPTY_HANDLE, BOOT_CAUSE, ctx.timestamp, obsolete);
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
class Launch extends FieldVersion {
|
|
@@ -307,7 +308,7 @@ class Launch extends FieldVersion {
|
|
|
307
308
|
const tran = this.transaction;
|
|
308
309
|
if (tran.changeset === changeset) {
|
|
309
310
|
}
|
|
310
|
-
else if (!tran.isFinished && this !== observable)
|
|
311
|
+
else if (!tran.isFinished && this !== observable && !this.options.allowObsoleteToFinish)
|
|
311
312
|
tran.cancel(new Error(`T${tran.id}[${tran.hint}] is canceled due to obsolete ${Dump.snapshot2(h, changeset, fk)} changed by T${changeset.id}[${changeset.hint}]`), null);
|
|
312
313
|
}
|
|
313
314
|
else if (Log.isOn && (Log.opt.obsolete || ((_c = this.options.logging) === null || _c === void 0 ? void 0 : _c.obsolete)))
|
|
@@ -533,7 +534,11 @@ class Launch extends FieldVersion {
|
|
|
533
534
|
else
|
|
534
535
|
former.successor = undefined;
|
|
535
536
|
}
|
|
536
|
-
(_a = former.observers) === null || _a === void 0 ? void 0 : _a.forEach(s =>
|
|
537
|
+
(_a = former.observers) === null || _a === void 0 ? void 0 : _a.forEach(s => {
|
|
538
|
+
const t = s.transaction;
|
|
539
|
+
const o = t.isFinished ? obsolete : t.changeset.obsolete;
|
|
540
|
+
return s.markObsoleteDueTo(former, fk, ov.changeset, h, why, timestamp, o);
|
|
541
|
+
});
|
|
537
542
|
}
|
|
538
543
|
}
|
|
539
544
|
if (curr instanceof Launch) {
|
|
@@ -20,7 +20,7 @@ export declare abstract class Transaction implements Worker {
|
|
|
20
20
|
abstract cancel(error: Error, retryAfterOrIgnore?: Worker | null): this;
|
|
21
21
|
abstract readonly isCanceled: boolean;
|
|
22
22
|
abstract readonly isFinished: boolean;
|
|
23
|
-
whenFinished(): Promise<void>;
|
|
23
|
+
whenFinished(includingParent?: boolean): Promise<void>;
|
|
24
24
|
static create(options: SnapshotOptions | null, parent?: Transaction): Transaction;
|
|
25
25
|
static run<T>(options: SnapshotOptions | null, func: F<T>, ...args: any[]): T;
|
|
26
26
|
static isolate<T>(func: F<T>, ...args: any[]): T;
|
|
@@ -14,7 +14,7 @@ import { Meta } from "./Data.js";
|
|
|
14
14
|
import { Changeset, Dump, EMPTY_OBJECT_VERSION, UNDEFINED_REVISION } from "./Changeset.js";
|
|
15
15
|
export class Transaction {
|
|
16
16
|
static get current() { return TransactionImpl.current; }
|
|
17
|
-
whenFinished() {
|
|
17
|
+
whenFinished(includingParent) {
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () { });
|
|
19
19
|
}
|
|
20
20
|
static create(options, parent) { return new TransactionImpl(options, parent); }
|