@rotorsoft/act 1.31.10 → 1.31.12

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
@@ -95,11 +95,12 @@ function classify_registry(registry, states) {
95
95
  set.add(lane_name);
96
96
  event_to_lanes.set(name, set);
97
97
  }
98
- if (!target_lanes.has(target)) {
99
- target_lanes.set(target, lane);
100
- } else if ((target_lanes.get(target) ?? void 0) !== (lane ?? void 0)) {
98
+ const recorded_lane = target_lanes.get(target);
99
+ if (recorded_lane === void 0) {
100
+ target_lanes.set(target, lane_name);
101
+ } else if (recorded_lane !== lane_name) {
101
102
  throw new Error(
102
- `Stream "${target}" has conflicting lane assignments ("${target_lanes.get(target) ?? "default"}" vs "${lane ?? "default"}")`
103
+ `Stream "${target}" has conflicting lane assignments ("${recorded_lane}" vs "${lane_name}")`
103
104
  );
104
105
  }
105
106
  const key = `${target}|${source ?? ""}`;
@@ -1419,18 +1420,18 @@ var registry_key = (events) => {
1419
1420
  return createHash("sha256").update(JSON.stringify(shape)).digest("hex").slice(0, 32);
1420
1421
  };
1421
1422
  var PATTERN_CACHE_SIZE = 32;
1422
- function report_undeclared_lane(seen, target, lane, declared) {
1423
+ function report_undeclared_lane(seen, handler, target, lane, declared) {
1423
1424
  report_once(
1424
1425
  seen,
1425
- `lane|${target}|${lane}`,
1426
- `Reaction resolved target "${target}" onto undeclared lane "${lane}". Declared lanes: ${[...declared].map((l) => `"${l}"`).join(", ")}. No controller claims it, so the stream would never drain \u2014 running it on "default" instead. The equivalent static \`.to({ lane })\` is rejected at build; a dynamic resolver's lane is only knowable here.`
1426
+ `lane|${handler}|${lane}`,
1427
+ `Reaction "${handler}" resolved onto undeclared lane "${lane}" \u2014 for example target "${target}". Declared lanes: ${[...declared].map((l) => `"${l}"`).join(", ")}. No controller claims it, so the stream would never drain \u2014 running it on "default" instead. The equivalent static \`.to({ lane })\` is rejected at build; a dynamic resolver's lane is only knowable here.`
1427
1428
  );
1428
1429
  }
1429
- function report_lane_conflict(seen, target, kept, dropped) {
1430
+ function report_lane_conflict(seen, handler, target, kept, dropped) {
1430
1431
  report_once(
1431
1432
  seen,
1432
- `conflict|${target}|${kept}|${dropped}`,
1433
- `Stream "${target}" has conflicting lane assignments ("${kept}" vs "${dropped}") from two dynamic resolutions at equal priority. Keeping "${kept}", the lane it was first discovered on \u2014 re-laning a live stream would move it out from under a worker holding its lease. The reaction resolving "${dropped}" runs inside the "${kept}" lane's budget, and a process restricted to "${dropped}" via onlyLanes never runs it. The equivalent static declaration is rejected at build; align the resolvers, or split the target.`
1433
+ `conflict|${handler}|${kept}|${dropped}`,
1434
+ `Reaction "${handler}" resolved lane "${dropped}" for a stream already on "${kept}" \u2014 for example "${target}". These are conflicting lane assignments from two dynamic resolutions at equal priority. Keeping "${kept}", the lane it was first discovered on \u2014 re-laning a live stream would move it out from under a worker holding its lease. The reaction resolving "${dropped}" runs inside the "${kept}" lane's budget, and a process restricted to "${dropped}" via onlyLanes never runs it. The equivalent static declaration is rejected at build; align the resolvers, or split the target.`
1434
1435
  );
1435
1436
  }
1436
1437
  var CorrelateCycle = class {
@@ -1683,6 +1684,7 @@ var CorrelateCycle = class {
1683
1684
  if (lane !== void 0 && !this._declared_lanes.has(lane)) {
1684
1685
  report_undeclared_lane(
1685
1686
  this._reported,
1687
+ reaction.handler.name,
1686
1688
  resolved.target,
1687
1689
  lane,
1688
1690
  this._declared_lanes
@@ -1702,7 +1704,13 @@ var CorrelateCycle = class {
1702
1704
  };
1703
1705
  const held = correlated.has(resolved.target) ? entry.lane : recorded?.lane;
1704
1706
  if (held !== void 0 && lane !== void 0 && held !== lane && priority === entry.priority)
1705
- report_lane_conflict(this._reported, resolved.target, held, lane);
1707
+ report_lane_conflict(
1708
+ this._reported,
1709
+ reaction.handler.name,
1710
+ resolved.target,
1711
+ held,
1712
+ lane
1713
+ );
1706
1714
  if (carried.priority > entry.priority) {
1707
1715
  entry.priority = carried.priority;
1708
1716
  entry.lane = carried.lane;