@rotorsoft/act 1.23.21 → 1.23.22

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
@@ -726,7 +726,7 @@ function synthesize_autoclose_reactions(registry, states, config2) {
726
726
  const stats = await store().query_stats([aggregate], {
727
727
  count: true,
728
728
  tail: keep_days !== void 0 ? true : void 0,
729
- exclude: keep_days !== void 0 ? [TOMBSTONE_EVENT, SNAP_EVENT] : [TOMBSTONE_EVENT]
729
+ exclude: [TOMBSTONE_EVENT, SNAP_EVENT]
730
730
  });
731
731
  const entry = stats.get(aggregate);
732
732
  if (!entry) return;
@@ -1378,12 +1378,13 @@ async function scan_stream_heads(streams) {
1378
1378
  const stats = await store().query_stats(streams, {
1379
1379
  exclude: [SNAP_EVENT]
1380
1380
  });
1381
+ const true_heads = await store().query_stats(streams, {});
1381
1382
  const out = /* @__PURE__ */ new Map();
1382
1383
  for (const [stream, { head }] of stats) {
1383
1384
  if (head.name === TOMBSTONE_EVENT) continue;
1384
1385
  out.set(stream, {
1385
1386
  max_id: head.id,
1386
- version: head.version,
1387
+ version: true_heads.get(stream).head.version,
1387
1388
  last_event_name: head.name
1388
1389
  });
1389
1390
  }