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
fix(signals): await object thenables and surface their sync rejections (closes#2764, #2765)
Introduce a shared object-only `isThenable` (Promises/A+ shape) used by both
the async runtime and `action()`:
- handleAsync now captures a synchronously-rejecting thenable and settles it
through the same status path an async rejection uses, so the error reaches
`Errored` instead of leaving the node stuck on the pending path (#2764).
- action() awaits any yielded object thenable, not just `instanceof Promise`,
matching `await` semantics for custom/cross-realm promises (#2765).
Co-authored-by: Cursor <cursoragent@cursor.com>
`action()` now awaits yielded object thenables, not just native `Promise` instances. Yielding a Promise-like object that is not `instanceof Promise` (a custom thenable, cache wrapper, or cross-realm promise) previously resumed the generator immediately with the raw object instead of its settled value. Yield handling now uses an object-thenability check (`typeof value === "object" && typeof value.then === "function"`), shared with the async runtime's thenable detection (#2765).
Surface synchronously-rejecting thenables. A memo returning a Promise-like thenable that invoked its rejection handler synchronously during `.then()` (e.g. a cache that already knows it failed) had its error dropped and stayed stuck on the pending path forever — `<Loading>` never gave way to `<Errored>`. The thenable branch now captures a synchronous rejection (mirroring the existing sync-resolve handling) and settles it, so the error reaches the boundary the same way an async rejection does (#2764).
0 commit comments