You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: unwrap discarded AsyncResults and fix non-exhaustive matchers
Addresses PR review. `AsyncResult` is a success-only thenable — its
internal promise never rejects (core.ts:616) — so `await` collapses it
to a Result and a bare `await handle.signals.x(...)` or
`await schedule.pause(...)` discards the failure entirely.
Copilot flagged four sites; the same bug was present at ~15. All are
now unwrapped with `.get()` / `.getOrThrow()` or an explicit branch, and
the trap is documented in the-result-model.md ("`await` is not an
extractor") plus inline warnings on the schedule, signals, and upgrade
pages.
Also fixes the interceptor short-circuit, which returned
`Err(new RuntimeClientError(...))`. That is both a type error —
`ClientCallError` excludes it since 8.0 — and the wrong channel. It now
defects via `fromSafePromise`, and the note points at the `defect`
helper passed as the second argument to every `*ErrCases` callback.
Auditing that turned up a further class of broken example: all the
`*ErrCases` combinators require an `ExhaustiveMatch`, so the single-arm
`.with(tag(...))` calls in the interceptor and middleware pages would
not compile against their wide unions. Those now close with `P._`, and
the abbreviated before/after snippets in the migration guides are
labelled as such.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments