@rotorsoft/act 1.23.8 → 1.23.9

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
@@ -20,7 +20,7 @@ import {
20
20
  sleep,
21
21
  store,
22
22
  validate
23
- } from "./chunk-7PG2SR37.js";
23
+ } from "./chunk-T722JHPU.js";
24
24
  import {
25
25
  ActorSchema,
26
26
  CausationEventSchema,
@@ -2426,9 +2426,10 @@ async function run_drain_cycle(ops, registry, batch_handlers, handle, handle_bat
2426
2426
  })
2427
2427
  );
2428
2428
  const acked = await ops.ack(
2429
- handled.flatMap(
2430
- (h) => h.defer !== void 0 ? { ...h.lease, due: h.defer, retry: -1 } : h.handled > 0 || !h.error ? { ...h.lease, at: h.acked_at } : h.next_attempt_at !== void 0 ? { ...h.lease, due: h.next_attempt_at } : []
2431
- )
2429
+ handled.flatMap((h, i) => {
2430
+ const advance = h.handled > 0 ? h.acked_at : leased[i].at;
2431
+ return h.defer !== void 0 ? { ...h.lease, at: advance, due: h.defer, retry: -1 } : h.next_attempt_at !== void 0 ? { ...h.lease, at: advance, due: h.next_attempt_at } : h.handled > 0 || !h.error ? { ...h.lease, at: h.acked_at } : [];
2432
+ })
2432
2433
  );
2433
2434
  const blocked = await ops.block(
2434
2435
  handled.filter(({ block: block2 }) => block2).map(({ lease, error }) => ({ ...lease, error }))