@rotorsoft/act 1.35.2 → 1.35.3

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/index.js CHANGED
@@ -746,7 +746,7 @@ var CircuitBreaker = class {
746
746
  };
747
747
 
748
748
  // src/internal/classify.ts
749
- var ALL_LANES = /* @__PURE__ */ Symbol("act-1103/all-lanes");
749
+ var ALL_LANES = /* @__PURE__ */ Symbol("act/all-lanes");
750
750
  function classify_registry(registry, states) {
751
751
  const statics = /* @__PURE__ */ new Map();
752
752
  const target_lanes = /* @__PURE__ */ new Map();
@@ -2097,7 +2097,7 @@ function build_es(logger, correlator = default_correlator, patch_fn = bare_patch
2097
2097
  action_name,
2098
2098
  target,
2099
2099
  payload,
2100
- { correlator, ...options },
2100
+ { ...options, correlator: options?.correlator ?? correlator },
2101
2101
  patch_fn
2102
2102
  );
2103
2103
  const bound_load = (me, target, callback) => load(me, target, callback, patch_fn);
@@ -2137,17 +2137,15 @@ function build_es(logger, correlator = default_correlator, patch_fn = bare_patch
2137
2137
  action: traced(
2138
2138
  bound_action,
2139
2139
  (snapshots, _me, _action, target) => {
2140
- const committed = snapshots.filter((s) => s.event);
2141
- if (committed.length) {
2140
+ if (snapshots[0].patch)
2142
2141
  logger.trace(
2143
- committed.map((s) => s.event.data),
2142
+ snapshots.map((s) => s.event.data),
2144
2143
  es_caption(
2145
2144
  "committed",
2146
2145
  C_ORANGE,
2147
- `${target.stream}.${committed.map((s) => s.event.name).join(", ")}`
2146
+ `${target.stream}.${snapshots.map((s) => s.event.name).join(", ")}`
2148
2147
  )
2149
2148
  );
2150
- }
2151
2149
  },
2152
2150
  (_me, action2, target, payload) => {
2153
2151
  logger.trace(
@@ -2586,7 +2584,7 @@ function pii_strip(event, fields) {
2586
2584
 
2587
2585
  // src/internal/projection-fold.ts
2588
2586
  var FOLD_RESET = /* @__PURE__ */ Symbol("act.fold.reset");
2589
- function make_fold_handler(me, flush, config2, patch_fn, sensitive_fields) {
2587
+ function make_fold_handler(me, flush, config2, sensitive_fields) {
2590
2588
  const load_me = {
2591
2589
  ...me,
2592
2590
  view: (raw, actor) => {
@@ -2616,7 +2614,7 @@ function make_fold_handler(me, flush, config2, patch_fn, sensitive_fields) {
2616
2614
  if (evictee.dirty) await flush([row(evictee)]);
2617
2615
  cache2.delete(oldest);
2618
2616
  }
2619
- const snapshot = await load(load_me, { stream }, void 0, patch_fn);
2617
+ const snapshot = await load(load_me, { stream });
2620
2618
  const seated = {
2621
2619
  stream,
2622
2620
  state: snapshot.state,
@@ -2647,7 +2645,7 @@ function make_fold_handler(me, flush, config2, patch_fn, sensitive_fields) {
2647
2645
  }
2648
2646
  if (event.id > fold.event_id) {
2649
2647
  const reducer = me.patch[event.name];
2650
- fold.state = patch_fn(
2648
+ fold.state = bare_patch(
2651
2649
  me,
2652
2650
  fold.state,
2653
2651
  reducer(event, fold.state),
@@ -3359,6 +3357,7 @@ var Act = class {
3359
3357
  payload,
3360
3358
  do_options
3361
3359
  );
3360
+ if (!snapshots[0].patch) return snapshots;
3362
3361
  this._wake(snapshots.map((s) => s.event.name));
3363
3362
  this.emit("committed", snapshots);
3364
3363
  return snapshots;
@@ -4663,7 +4662,6 @@ function act() {
4663
4662
  spec.merged,
4664
4663
  spec.flush,
4665
4664
  spec.config,
4666
- bare_patch,
4667
4665
  // Head loads strip sensitive keys like the warm path.
4668
4666
  registry.sensitive_fields
4669
4667
  )