@rotorsoft/act 1.23.15 → 1.23.16

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
@@ -2607,7 +2607,15 @@ var DrainController = class {
2607
2607
  };
2608
2608
 
2609
2609
  // src/internal/projection-fold.ts
2610
- function make_fold_handler(me, flush, config2, patch_fn = bare_patch) {
2610
+ function make_fold_handler(me, flush, config2, patch_fn = bare_patch, sensitive_fields) {
2611
+ const load_me = {
2612
+ ...me,
2613
+ view: (raw, actor) => {
2614
+ const viewed = me.view(raw, actor);
2615
+ const fields = sensitive_fields(viewed.name);
2616
+ return fields.length ? pii_strip(viewed, fields) : viewed;
2617
+ }
2618
+ };
2611
2619
  const cache2 = /* @__PURE__ */ new Map();
2612
2620
  const row = ({ dirty: _, ...row2 }) => row2;
2613
2621
  const flush_dirty = async () => {
@@ -2637,7 +2645,7 @@ function make_fold_handler(me, flush, config2, patch_fn = bare_patch) {
2637
2645
  if (evictee.dirty) await flush([row(evictee)]);
2638
2646
  cache2.delete(oldest);
2639
2647
  }
2640
- const snapshot = await load(me, { stream }, void 0, patch_fn);
2648
+ const snapshot = await load(load_me, { stream }, void 0, patch_fn);
2641
2649
  fold = {
2642
2650
  stream,
2643
2651
  state: snapshot.state,
@@ -4357,7 +4365,16 @@ function act() {
4357
4365
  );
4358
4366
  batch_handlers.set(
4359
4367
  proj.target,
4360
- make_fold_handler(merged, fold.flush, fold.config, patch_fn)
4368
+ make_fold_handler(
4369
+ merged,
4370
+ fold.flush,
4371
+ fold.config,
4372
+ patch_fn,
4373
+ // Head loads strip sensitive keys like the warm path (#1320).
4374
+ // `_sf` is populated in the events pass below; read lazily at
4375
+ // fold time, by when the map is complete.
4376
+ (event_name) => _sf.get(event_name) ?? []
4377
+ )
4361
4378
  );
4362
4379
  }
4363
4380
  finalize_deprecations();