@rotorsoft/act 1.34.1 → 1.34.2

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
@@ -40,7 +40,7 @@ import {
40
40
  sleep,
41
41
  store,
42
42
  validate
43
- } from "./chunk-5F2TQ4PT.js";
43
+ } from "./chunk-IEM2NS6J.js";
44
44
  import {
45
45
  ActorSchema,
46
46
  CausationEventSchema,
@@ -3561,8 +3561,9 @@ var Act = class {
3561
3561
  * the event), and marks their work so the next drain can claim it.
3562
3562
  *
3563
3563
  * @param query - Only `limit` is used: the most events the pass reads
3564
- * (default 10). The scan always starts at the correlation checkpoint,
3565
- * which every reaction shares, so filters and `after` are ignored.
3564
+ * (10 when the query has none; `0` reads everything). The scan always
3565
+ * starts at the correlation checkpoint, which every reaction shares, so
3566
+ * filters and `after` are ignored.
3566
3567
  * @returns The number of newly subscribed streams and the last scanned event id
3567
3568
  *
3568
3569
  * @example Manual correlation
@@ -3572,8 +3573,8 @@ var Act = class {
3572
3573
  *
3573
3574
  * @see {@link start_correlations} for automatic periodic correlation
3574
3575
  */
3575
- async correlate(query = { limit: 10 }) {
3576
- const pass = await this._correlate_pass(query);
3576
+ async correlate(query = {}) {
3577
+ const pass = await this._correlate_pass({ limit: query.limit ?? 10 });
3577
3578
  return {
3578
3579
  subscribed: pass.kind === "scanned" ? pass.subscribed : 0,
3579
3580
  last_id: pass.last_id
@@ -4230,7 +4231,7 @@ function autoclose_of(existing, state2) {
4230
4231
  }
4231
4232
  function merge_into_existing(state2, existing, states, actions, events) {
4232
4233
  for (const name of Object.keys(state2.actions)) {
4233
- if (existing.actions[name] === state2.actions[name]) continue;
4234
+ if (existing.on[name] === state2.on[name]) continue;
4234
4235
  if (actions[name]) throw new Error(`Duplicate action "${name}"`);
4235
4236
  }
4236
4237
  for (const name of Object.keys(state2.events)) {