@rotorsoft/act 1.31.8 → 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
@@ -1806,7 +1806,9 @@ var CorrelateCycle = class {
1806
1806
  millis: 0
1807
1807
  });
1808
1808
  } catch (error) {
1809
- log().error(error);
1809
+ log().warn(
1810
+ `Could not hand back the correlation lease during shutdown; it expires on its own within ${this._lease_millis}ms and correlation resumes normally after that. On a single-writer store this usually means another connection holds the database. Cause: ${String(error)}`
1811
+ );
1810
1812
  }
1811
1813
  }
1812
1814
  stop_polling() {
@@ -2241,7 +2243,12 @@ async function load(me, target, callback, patch_fn = bare_patch) {
2241
2243
  event_id: event.id,
2242
2244
  patches,
2243
2245
  snaps
2244
- }).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
+ );
2245
2252
  }
2246
2253
  return {
2247
2254
  event,
@@ -2340,7 +2347,12 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
2340
2347
  );
2341
2348
  } catch (error) {
2342
2349
  if (error instanceof ConcurrencyError) {
2343
- 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
+ );
2344
2356
  }
2345
2357
  throw error;
2346
2358
  }
@@ -2375,9 +2387,19 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
2375
2387
  event_id: snap_event?.id ?? last.event.id,
2376
2388
  patches: snap_event ? 0 : last.patches,
2377
2389
  snaps: snap_event ? last.snaps + 1 : last.snaps
2378
- }).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
+ );
2379
2396
  else
2380
- 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
+ );
2381
2403
  }
2382
2404
  return snapshots;
2383
2405
  } catch (error) {
@@ -2651,10 +2673,8 @@ async function run_drain_cycle(ops, registry, batch_handlers, misrouted, handle,
2651
2673
  const acked = await ops.ack(submitted);
2652
2674
  const expected = submitted.filter((l) => l.due === void 0).length;
2653
2675
  if (acked.length < expected)
2654
- log().error(
2655
- new Error(
2656
- `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.`
2657
- )
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.`
2658
2678
  );
2659
2679
  const closeable = handled.filter((h) => h.close !== void 0).map((h) => h.close);
2660
2680
  return { leased, fetched, handled, acked, blocked, closeable };