@rotorsoft/act 1.23.15 → 1.23.17

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
@@ -775,6 +775,7 @@ function synthesize_autoclose_reactions(registry, states, config2) {
775
775
  var ALL_LANES = /* @__PURE__ */ Symbol("act-1103/all-lanes");
776
776
  function classify_registry(registry, states) {
777
777
  const statics = /* @__PURE__ */ new Map();
778
+ const target_lanes = /* @__PURE__ */ new Map();
778
779
  const reactive_events = /* @__PURE__ */ new Set();
779
780
  const event_to_lanes = /* @__PURE__ */ new Map();
780
781
  let has_dynamic_resolvers = false;
@@ -793,18 +794,19 @@ function classify_registry(registry, states) {
793
794
  set.add(lane_name);
794
795
  event_to_lanes.set(name, set);
795
796
  }
797
+ if (!target_lanes.has(target)) {
798
+ target_lanes.set(target, lane);
799
+ } else if ((target_lanes.get(target) ?? void 0) !== (lane ?? void 0)) {
800
+ throw new Error(
801
+ `Stream "${target}" has conflicting lane assignments ("${target_lanes.get(target) ?? "default"}" vs "${lane ?? "default"}")`
802
+ );
803
+ }
796
804
  const key = `${target}|${source ?? ""}`;
797
805
  const existing = statics.get(key);
798
806
  if (!existing) {
799
807
  statics.set(key, { stream: target, source, priority, lane });
800
- } else {
801
- if ((existing.lane ?? void 0) !== (lane ?? void 0))
802
- throw new Error(
803
- `Stream "${target}" has conflicting lane assignments ("${existing.lane ?? "default"}" vs "${lane ?? "default"}")`
804
- );
805
- if (priority > existing.priority) {
806
- statics.set(key, { ...existing, priority });
807
- }
808
+ } else if (priority > existing.priority) {
809
+ statics.set(key, { ...existing, priority });
808
810
  }
809
811
  }
810
812
  }
@@ -2607,7 +2609,15 @@ var DrainController = class {
2607
2609
  };
2608
2610
 
2609
2611
  // src/internal/projection-fold.ts
2610
- function make_fold_handler(me, flush, config2, patch_fn = bare_patch) {
2612
+ function make_fold_handler(me, flush, config2, patch_fn = bare_patch, sensitive_fields) {
2613
+ const load_me = {
2614
+ ...me,
2615
+ view: (raw, actor) => {
2616
+ const viewed = me.view(raw, actor);
2617
+ const fields = sensitive_fields(viewed.name);
2618
+ return fields.length ? pii_strip(viewed, fields) : viewed;
2619
+ }
2620
+ };
2611
2621
  const cache2 = /* @__PURE__ */ new Map();
2612
2622
  const row = ({ dirty: _, ...row2 }) => row2;
2613
2623
  const flush_dirty = async () => {
@@ -2637,7 +2647,7 @@ function make_fold_handler(me, flush, config2, patch_fn = bare_patch) {
2637
2647
  if (evictee.dirty) await flush([row(evictee)]);
2638
2648
  cache2.delete(oldest);
2639
2649
  }
2640
- const snapshot = await load(me, { stream }, void 0, patch_fn);
2650
+ const snapshot = await load(load_me, { stream }, void 0, patch_fn);
2641
2651
  fold = {
2642
2652
  stream,
2643
2653
  state: snapshot.state,
@@ -4357,7 +4367,16 @@ function act() {
4357
4367
  );
4358
4368
  batch_handlers.set(
4359
4369
  proj.target,
4360
- make_fold_handler(merged, fold.flush, fold.config, patch_fn)
4370
+ make_fold_handler(
4371
+ merged,
4372
+ fold.flush,
4373
+ fold.config,
4374
+ patch_fn,
4375
+ // Head loads strip sensitive keys like the warm path (#1320).
4376
+ // `_sf` is populated in the events pass below; read lazily at
4377
+ // fold time, by when the map is complete.
4378
+ (event_name) => _sf.get(event_name) ?? []
4379
+ )
4361
4380
  );
4362
4381
  }
4363
4382
  finalize_deprecations();