Skip to content

Commit 9af14ef

Browse files
committed
fix(sdk): mirror skipSuspend WaitpointTimeoutError on session.in waits
The session.in version of waitWithIdleTimeout had the same shape inconsistency as the input-stream version (fixed on se): the skipSuspend branch returned { ok: false, error: undefined } instead of a real WaitpointTimeoutError. Now matches the cold-phase wait() result shape so callers can rely on a uniform { error: WaitpointTimeoutError } on every !ok path.
1 parent 90cbd46 commit 9af14ef

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/trigger-sdk/src/v3/sessions.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,16 @@ export class SessionInputChannel {
677677
}
678678

679679
if (options.skipSuspend) {
680+
// Match the cold-phase `self.wait()` result shape below so any
681+
// caller that does `throw result.error` gets a real error
682+
// instead of `undefined`.
680683
span.setAttribute("wait.resolved", "skipped");
681-
return { ok: false as const, error: undefined };
684+
return {
685+
ok: false as const,
686+
error: new WaitpointTimeoutError(
687+
"Idle timeout elapsed and skipSuspend is set"
688+
),
689+
};
682690
}
683691

684692
if (options.onSuspend) {

0 commit comments

Comments
 (0)