Skip to content

Commit 41fb9d4

Browse files
committed
chore(run-engine): say so when an unparseable maxDelay leaves a run unbounded
The fallback for an unparseable maxDelay is the server ceiling, which is now normally unset, so the old log line claimed a bound that no longer exists. Name the real outcome instead.
1 parent 11b3be4 commit 41fb9d4

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

internal-packages/run-engine/src/engine/systems/debounceSystem.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,9 @@ return 0
576576
/**
577577
* How long after a run's `createdAt` triggers may keep pushing it back, or `undefined` for
578578
* no bound at all. A trigger's own `maxDelay` wins; otherwise the server ceiling applies,
579-
* which is itself unset by default. An unparseable `maxDelay` falls back to the ceiling.
579+
* which is itself unset by default. An unparseable `maxDelay` falls back to the ceiling, and
580+
* so to no bound when no ceiling is configured. Callers that reach the engine through the
581+
* trigger API never get that far, since an unparseable `maxDelay` is rejected there.
580582
*/
581583
#resolveMaxDurationMs(debounce: DebounceOptions): number | undefined {
582584
if (debounce.maxDelay === undefined) {
@@ -586,10 +588,15 @@ return 0
586588
const parsedMaxDelay = parseNaturalLanguageDurationInMs(debounce.maxDelay);
587589

588590
if (parsedMaxDelay === undefined) {
589-
this.$.logger.warn("handleExistingRun: invalid maxDelay duration, using server ceiling", {
590-
maxDelay: debounce.maxDelay,
591-
fallbackMs: this.maxDebounceDurationMs,
592-
});
591+
this.$.logger.warn(
592+
this.maxDebounceDurationMs === undefined
593+
? "handleExistingRun: invalid maxDelay duration and no server ceiling, the run can be pushed back indefinitely"
594+
: "handleExistingRun: invalid maxDelay duration, using server ceiling",
595+
{
596+
maxDelay: debounce.maxDelay,
597+
fallbackMs: this.maxDebounceDurationMs,
598+
}
599+
);
593600
return this.maxDebounceDurationMs;
594601
}
595602

0 commit comments

Comments
 (0)