@rotorsoft/act 2.0.3 → 2.0.5

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
@@ -48,7 +48,7 @@ import {
48
48
  store,
49
49
  throw_if_stale,
50
50
  validate
51
- } from "./chunk-YAHM7P64.js";
51
+ } from "./chunk-3JULRYQO.js";
52
52
  import {
53
53
  ActorSchema,
54
54
  CausationEventSchema,
@@ -3688,7 +3688,6 @@ var Act = class {
3688
3688
  do_options
3689
3689
  );
3690
3690
  if (!snapshots[0].patch) return snapshots;
3691
- const me = this.registry.actions[action2];
3692
3691
  this._wake(snapshots.map((s) => s.event.name));
3693
3692
  const by_stream = /* @__PURE__ */ new Map();
3694
3693
  for (const s of snapshots) {
@@ -3696,10 +3695,10 @@ var Act = class {
3696
3695
  if (of_stream) of_stream.push(s);
3697
3696
  else by_stream.set(s.event.stream, [s]);
3698
3697
  }
3699
- for (const [stream, of_stream] of by_stream) {
3700
- const owner = stream === target.stream ? me : me.loads[action2].find(
3701
- (l) => l.events.includes(of_stream[0].event.name)
3702
- ).state;
3698
+ for (const of_stream of by_stream.values()) {
3699
+ const owner = this._event_to_state.get(
3700
+ of_stream[0].event.name
3701
+ );
3703
3702
  this.emit("committed", of_stream);
3704
3703
  this._notify(`committed:${owner.name}`, of_stream);
3705
3704
  }