@rotorsoft/act 2.1.11 → 2.1.12

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
@@ -4056,6 +4056,13 @@ var Act = class {
4056
4056
  stop_settling() {
4057
4057
  this._settle.stop();
4058
4058
  }
4059
+ // Drop every fold cache before a replay, or a warm cache would re-flush
4060
+ // stale rows. Cleared for all targets: resolving a filter costs a query,
4061
+ // and an extra clear costs one head load per stream.
4062
+ _reset_folds() {
4063
+ for (const handler of this._batch_handlers.values())
4064
+ handler[FOLD_RESET]?.();
4065
+ }
4059
4066
  /**
4060
4067
  * Reset reaction stream watermarks and settle them, replaying their
4061
4068
  * events through their reactions.
@@ -4084,8 +4091,7 @@ var Act = class {
4084
4091
  async reset(input) {
4085
4092
  return this._scoped(async () => {
4086
4093
  const count = await store().reset(input);
4087
- for (const handler of this._batch_handlers.values())
4088
- handler[FOLD_RESET]?.();
4094
+ this._reset_folds();
4089
4095
  if (count > 0) {
4090
4096
  this._wake();
4091
4097
  }
@@ -4191,6 +4197,7 @@ var Act = class {
4191
4197
  if (sink) await run();
4192
4198
  else {
4193
4199
  await this._correlate.restart(run);
4200
+ this._reset_folds();
4194
4201
  this._wake();
4195
4202
  }
4196
4203
  return { kept, migrated, dropped, duration_ms: Date.now() - started };