@rotorsoft/act 1.32.9 → 1.32.11

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
@@ -26,7 +26,7 @@ import {
26
26
  sleep,
27
27
  store,
28
28
  validate
29
- } from "./chunk-F4F5AKM3.js";
29
+ } from "./chunk-UVFP2BQ3.js";
30
30
  import {
31
31
  ActorSchema,
32
32
  CausationEventSchema,
@@ -3432,9 +3432,13 @@ function build_handle(deps) {
3432
3432
  function build_handle_batch(logger) {
3433
3433
  return async (lease, payloads, batchHandler) => {
3434
3434
  const stream = lease.stream;
3435
- const events = payloads.map(
3436
- (p) => p.event
3437
- );
3435
+ const events = [];
3436
+ const seen = /* @__PURE__ */ new Set();
3437
+ for (const p of payloads) {
3438
+ if (seen.has(p.event.id)) continue;
3439
+ seen.add(p.event.id);
3440
+ events.push(p.event);
3441
+ }
3438
3442
  const options = payloads[0].options;
3439
3443
  if (lease.retry > 0)
3440
3444
  logger.warn(`Retrying batch ${stream}@${events[0].id} (${lease.retry}).`);