@dudousxd/nestjs-durable 0.45.1 → 0.46.0

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.cjs CHANGED
@@ -1612,7 +1612,7 @@ var StoreRunGateway = class {
1612
1612
  }
1613
1613
  async listRuns(query) {
1614
1614
  const runs = await this.store.listRuns(query);
1615
- const waiterByRun = (0, import_nestjs_durable_core9.indexWaitersByRun)(await this.store.listSignalWaiters(""));
1615
+ const waiterByRun = (0, import_nestjs_durable_core9.indexWaitersByRun)(await (0, import_nestjs_durable_core9.listSignalWaitersOfRuns)(this.store, runs.filter((run) => run.status === "suspended").map((run) => run.id)));
1616
1616
  return runs.map((run) => {
1617
1617
  const waiting = (0, import_nestjs_durable_core9.resolveRunWaiting)(run, waiterByRun);
1618
1618
  return waiting ? {
@@ -1649,12 +1649,12 @@ var StoreRunGateway = class {
1649
1649
  /**
1650
1650
  * Bulk-resolve what each of `runIds` is currently parked on — for a consumer with its own filtered/
1651
1651
  * paginated run listing (e.g. "which of MY suspended runs are stuck at a breakpoint") without
1652
- * re-deriving `listRuns`' waiter scan or querying `durable_step_checkpoints` directly. Mirrors
1653
- * `listRuns`' waiting computation (the SAME bulk signal-waiter scan + `resolveRunWaiting`), but ALSO
1652
+ * re-deriving `listRuns`' waiter read or querying `durable_step_checkpoints` directly. Mirrors
1653
+ * `listRuns`' waiting computation (the requested runs' signal waiters + `resolveRunWaiting`), but ALSO
1654
1654
  * bulk-fetches the currently-suspended runs to check real status: `engine.cancel` (the non-compensate
1655
1655
  * path) doesn't clear a run's signal waiter row, so a cancelled run can leave an ORPHANED waiter
1656
1656
  * behind — trusting waiter presence alone would wrongly report a terminal run as still waiting.
1657
- * Two bulk scans total (never one query per requested id), same as `listRuns`.
1657
+ * Two bulk reads total (never one query per requested id), same as `listRuns`.
1658
1658
  */
1659
1659
  async waitingFor(runIds) {
1660
1660
  if (runIds.length === 0) return {};
@@ -1665,7 +1665,7 @@ var StoreRunGateway = class {
1665
1665
  "suspended"
1666
1666
  ]
1667
1667
  }),
1668
- this.store.listSignalWaiters("")
1668
+ (0, import_nestjs_durable_core9.listSignalWaitersOfRuns)(this.store, runIds)
1669
1669
  ]);
1670
1670
  const waiterByRun = (0, import_nestjs_durable_core9.indexWaitersByRun)(waiters);
1671
1671
  const result = {};