@rotorsoft/act 1.31.9 → 1.31.10

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
@@ -2243,7 +2243,12 @@ async function load(me, target, callback, patch_fn = bare_patch) {
2243
2243
  event_id: event.id,
2244
2244
  patches,
2245
2245
  snaps
2246
- }).catch((err) => log().error(err));
2246
+ }).catch(
2247
+ (err) => log().warn(
2248
+ err,
2249
+ "cache set skipped; the next load re-folds from the store"
2250
+ )
2251
+ );
2247
2252
  }
2248
2253
  return {
2249
2254
  event,
@@ -2342,7 +2347,12 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
2342
2347
  );
2343
2348
  } catch (error) {
2344
2349
  if (error instanceof ConcurrencyError) {
2345
- cache().invalidate(stream).catch((err) => log().error(err));
2350
+ cache().invalidate(stream).catch(
2351
+ (err) => log().warn(
2352
+ err,
2353
+ "cache invalidate skipped; a stale checkpoint re-folds from its event_id"
2354
+ )
2355
+ );
2346
2356
  }
2347
2357
  throw error;
2348
2358
  }
@@ -2377,9 +2387,19 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
2377
2387
  event_id: snap_event?.id ?? last.event.id,
2378
2388
  patches: snap_event ? 0 : last.patches,
2379
2389
  snaps: snap_event ? last.snaps + 1 : last.snaps
2380
- }).catch((err) => log().error(err));
2390
+ }).catch(
2391
+ (err) => log().warn(
2392
+ err,
2393
+ "cache set skipped; the next load re-folds from the store"
2394
+ )
2395
+ );
2381
2396
  else
2382
- cache().invalidate(stream).catch((err) => log().error(err));
2397
+ cache().invalidate(stream).catch(
2398
+ (err) => log().warn(
2399
+ err,
2400
+ "cache invalidate skipped; a stale checkpoint re-folds from its event_id"
2401
+ )
2402
+ );
2383
2403
  }
2384
2404
  return snapshots;
2385
2405
  } catch (error) {
@@ -2653,10 +2673,8 @@ async function run_drain_cycle(ops, registry, batch_handlers, misrouted, handle,
2653
2673
  const acked = await ops.ack(submitted);
2654
2674
  const expected = submitted.filter((l) => l.due === void 0).length;
2655
2675
  if (acked.length < expected)
2656
- log().error(
2657
- new Error(
2658
- `drain: ${expected - acked.length} of ${expected} acks were dropped \u2014 the lease was taken by another worker mid-handler. That work will be redelivered (at-least-once), but persistent drops mean leaseMillis is too short for this handler.`
2659
- )
2676
+ log().warn(
2677
+ `drain: ${expected - acked.length} of ${expected} acks were dropped \u2014 the lease was taken by another worker mid-handler. That work will be redelivered (at-least-once), but persistent drops mean leaseMillis is too short for this handler.`
2660
2678
  );
2661
2679
  const closeable = handled.filter((h) => h.close !== void 0).map((h) => h.close);
2662
2680
  return { leased, fetched, handled, acked, blocked, closeable };