@rotorsoft/act 1.12.0 → 1.12.1
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/.tsbuildinfo +1 -1
- package/dist/@types/builders/act-builder.d.ts.map +1 -1
- package/dist/@types/builders/projection-builder.d.ts.map +1 -1
- package/dist/@types/builders/slice-builder.d.ts.map +1 -1
- package/dist/@types/internal/merge.d.ts +4 -2
- package/dist/@types/internal/merge.d.ts.map +1 -1
- package/dist/@types/internal/tracing.d.ts.map +1 -1
- package/dist/{chunk-5PWLGL5E.js → chunk-QCSXT5MB.js} +2 -2
- package/dist/{chunk-5PWLGL5E.js.map → chunk-QCSXT5MB.js.map} +1 -1
- package/dist/index.cjs +21 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +10 -10
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +10 -10
- package/dist/test/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
sleep,
|
|
20
20
|
store,
|
|
21
21
|
validate
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QCSXT5MB.js";
|
|
23
23
|
import {
|
|
24
24
|
ActorSchema,
|
|
25
25
|
CausationEventSchema,
|
|
@@ -271,7 +271,7 @@ var make_restart_candidate_pass = (deps, options) => {
|
|
|
271
271
|
// names map is sparse — `__snapshot__` key absent when the
|
|
272
272
|
// stream has never been snapshotted (a common case for the
|
|
273
273
|
// restart-candidate signal).
|
|
274
|
-
snaps: names
|
|
274
|
+
snaps: names.__snapshot__ ?? 0
|
|
275
275
|
});
|
|
276
276
|
},
|
|
277
277
|
drain: () => findings
|
|
@@ -333,7 +333,7 @@ var make_snapshot_drift_pass = (deps, options) => {
|
|
|
333
333
|
candidates.push({
|
|
334
334
|
stream,
|
|
335
335
|
total: count,
|
|
336
|
-
snaps: names
|
|
336
|
+
snaps: names.__snapshot__ ?? 0
|
|
337
337
|
});
|
|
338
338
|
},
|
|
339
339
|
async finalize(deps2) {
|
|
@@ -1618,7 +1618,7 @@ function trace_cycle(logger, leased, fetched, handled, acked, blocked) {
|
|
|
1618
1618
|
const detail = leased.map(({ stream, at, retry }) => {
|
|
1619
1619
|
const f = fetch_by_stream.get(stream);
|
|
1620
1620
|
const key = f?.source ? `${hue(C_STREAM, stream)}${dim(`<-${f.source}`)}` : hue(C_STREAM, stream);
|
|
1621
|
-
const events = f
|
|
1621
|
+
const events = f?.events.length ? ` ${dim(
|
|
1622
1622
|
`[${f.events.map(({ id, name }) => `#${id} ${String(name)}`).join(", ")}]`
|
|
1623
1623
|
)}` : "";
|
|
1624
1624
|
const acked_at = acked_by_stream.get(stream);
|
|
@@ -1968,6 +1968,11 @@ function merge_event_register(target, source) {
|
|
|
1968
1968
|
const target_reg = target[event_name];
|
|
1969
1969
|
if (!target_reg) continue;
|
|
1970
1970
|
for (const [name, reaction] of source_reg.reactions) {
|
|
1971
|
+
const existing = target_reg.reactions.get(name);
|
|
1972
|
+
if (existing !== void 0 && existing !== reaction)
|
|
1973
|
+
throw new Error(
|
|
1974
|
+
`Duplicate reaction "${name}" for event "${event_name}". Reaction handlers are keyed by function name; rename one of them.`
|
|
1975
|
+
);
|
|
1971
1976
|
target_reg.reactions.set(name, reaction);
|
|
1972
1977
|
}
|
|
1973
1978
|
}
|
|
@@ -3418,6 +3423,10 @@ function act() {
|
|
|
3418
3423
|
throw new Error(
|
|
3419
3424
|
`Reaction handler for "${String(event)}" must be a named function`
|
|
3420
3425
|
);
|
|
3426
|
+
if (registry.events[event].reactions.has(handler.name))
|
|
3427
|
+
throw new Error(
|
|
3428
|
+
`Duplicate reaction "${handler.name}" for event "${String(event)}". Reaction handlers are keyed by function name; rename one of them.`
|
|
3429
|
+
);
|
|
3421
3430
|
registry.events[event].reactions.set(handler.name, reaction);
|
|
3422
3431
|
return Object.assign(builder, {
|
|
3423
3432
|
to(resolver) {
|
|
@@ -3534,6 +3543,10 @@ function _projection(target) {
|
|
|
3534
3543
|
throw new Error(
|
|
3535
3544
|
`Projection handler for "${event}" must be a named function`
|
|
3536
3545
|
);
|
|
3546
|
+
if (register.reactions.has(handler.name))
|
|
3547
|
+
throw new Error(
|
|
3548
|
+
`Duplicate projection handler "${handler.name}" for event "${event}". Projection handlers are keyed by function name; rename one of them.`
|
|
3549
|
+
);
|
|
3537
3550
|
register.reactions.set(handler.name, reaction);
|
|
3538
3551
|
const widened = base;
|
|
3539
3552
|
return Object.assign(widened, {
|
|
@@ -3609,6 +3622,10 @@ function slice() {
|
|
|
3609
3622
|
throw new Error(
|
|
3610
3623
|
`Reaction handler for "${String(event)}" must be a named function`
|
|
3611
3624
|
);
|
|
3625
|
+
if (events[event].reactions.has(handler.name))
|
|
3626
|
+
throw new Error(
|
|
3627
|
+
`Duplicate reaction "${handler.name}" for event "${String(event)}". Reaction handlers are keyed by function name; rename one of them.`
|
|
3628
|
+
);
|
|
3612
3629
|
events[event].reactions.set(handler.name, reaction);
|
|
3613
3630
|
return Object.assign(builder, {
|
|
3614
3631
|
to(resolver) {
|