@rotorsoft/act 1.23.16 → 1.23.18

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
@@ -755,10 +755,9 @@ function synthesize_autoclose_reactions(registry, states, config2) {
755
755
  dues.push(days_after(head.created, after_days));
756
756
  if (keep_days !== void 0)
757
757
  dues.push(days_after(entry.tail.created, keep_days));
758
- if (dues.length)
759
- throw new DeferSignal({
760
- at: new Date(Math.min(...dues.map((d) => d.getTime())))
761
- });
758
+ const future = dues.map((d) => d.getTime()).filter((t) => t > Date.now());
759
+ if (future.length)
760
+ throw new DeferSignal({ at: new Date(Math.min(...future)) });
762
761
  }
763
762
  };
764
763
  const key = `__autoclose_${st.name}`;
@@ -775,6 +774,7 @@ function synthesize_autoclose_reactions(registry, states, config2) {
775
774
  var ALL_LANES = /* @__PURE__ */ Symbol("act-1103/all-lanes");
776
775
  function classify_registry(registry, states) {
777
776
  const statics = /* @__PURE__ */ new Map();
777
+ const target_lanes = /* @__PURE__ */ new Map();
778
778
  const reactive_events = /* @__PURE__ */ new Set();
779
779
  const event_to_lanes = /* @__PURE__ */ new Map();
780
780
  let has_dynamic_resolvers = false;
@@ -793,18 +793,19 @@ function classify_registry(registry, states) {
793
793
  set.add(lane_name);
794
794
  event_to_lanes.set(name, set);
795
795
  }
796
+ if (!target_lanes.has(target)) {
797
+ target_lanes.set(target, lane);
798
+ } else if ((target_lanes.get(target) ?? void 0) !== (lane ?? void 0)) {
799
+ throw new Error(
800
+ `Stream "${target}" has conflicting lane assignments ("${target_lanes.get(target) ?? "default"}" vs "${lane ?? "default"}")`
801
+ );
802
+ }
796
803
  const key = `${target}|${source ?? ""}`;
797
804
  const existing = statics.get(key);
798
805
  if (!existing) {
799
806
  statics.set(key, { stream: target, source, priority, lane });
800
- } else {
801
- if ((existing.lane ?? void 0) !== (lane ?? void 0))
802
- throw new Error(
803
- `Stream "${target}" has conflicting lane assignments ("${existing.lane ?? "default"}" vs "${lane ?? "default"}")`
804
- );
805
- if (priority > existing.priority) {
806
- statics.set(key, { ...existing, priority });
807
- }
807
+ } else if (priority > existing.priority) {
808
+ statics.set(key, { ...existing, priority });
808
809
  }
809
810
  }
810
811
  }