@rotorsoft/act 1.23.19 → 1.23.21

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
@@ -2076,8 +2076,21 @@ async function load(me, target, callback, patch_fn = bare_patch) {
2076
2076
  // a non-time-travel cold load — a bounded load full-scans real events
2077
2077
  // under its `asOf` filter. This is the single floor-eligibility decision
2078
2078
  // for the whole system; the stores apply the floor whenever asked and
2079
- // never re-derive it (RFC 1274). The warm path resumes from `after`.
2080
- ...cached ? { after: cached.event_id } : { ...time_travel ? {} : { with_snaps: true }, ...asOf }
2079
+ // never re-derive it (RFC 1274).
2080
+ //
2081
+ // The warm path resumes from `after`, and MUST also carry `with_snaps`
2082
+ // (#1345): `after` and `with_snaps` are independent store conditions —
2083
+ // `after` bounds the scan (id > cached.event_id), `with_snaps` keeps
2084
+ // `__snapshot__` rows in the result. A stale (lagging/cross-process)
2085
+ // cache checkpoint can sit below a newer `__snapshot__` boundary, and a
2086
+ // windowed close (`app.close`/`.autocloses({keep})`) may have pruned the
2087
+ // domain events between the checkpoint and that snapshot. Without
2088
+ // `with_snaps` the rebaselining snapshot is filtered out and the fold
2089
+ // silently applies the surviving tail on top of stale state (wrong
2090
+ // count, yet `version` still reports the true head — the concurrency
2091
+ // guard passes). With it, the snapshot in the after-window rebaselines
2092
+ // the fold; when no snapshot falls in the window it is a no-op.
2093
+ ...cached ? { after: cached.event_id, with_snaps: true } : { ...time_travel ? {} : { with_snaps: true }, ...asOf }
2081
2094
  }
2082
2095
  );
2083
2096
  const head_is_tombstone = event?.name === TOMBSTONE_EVENT;