fix(core): reject open() on system teardown via cancelAll#30
Conversation
Add LayerCancelledError and cancelAll so parent-dismiss drains, group dispose, and host disconnect reject callers instead of resolving undefined. dismissAll(response) still completes with R.
🦋 Changeset detectedLatest commit: a31df36 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (60)
📝 WalkthroughWalkthroughAdds ChangesLayer cancellation semantics
Sequence Diagram(s)sequenceDiagram
participant Caller
participant LayerClient
participant LayerStack
Caller->>LayerClient: open()
LayerClient->>LayerStack: create active or queued layer
LayerClient->>LayerStack: cancelAll(reason)
LayerStack-->>Caller: reject with LayerCancelledError
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Restore Dismiss all → dismissAll (resolve) and Force clear → cancelAll (reject); tighten JSDoc/skills/docs and cancelAll fail-safety coverage.
Swallow isLayerCancelledError in nested/blocker demos; align createLayerGroup and Alpine dispose docs; fail-safe drainChildStacks; lit rebind uses groupDispose.
Summary
LayerCancelledError/isLayerCancelledErrorandLayerStack/LayerClient.cancelAllfor system teardown (Query-style cancel reject)cancelAllinstead ofdismissAll(undefined)dismissAll(response)still resolves withR(void stays unambiguous)Breaking note
Apps that awaited child/group
open()through parent dismiss or group unmount previously gotundefined. They now reject withLayerCancelledError— narrow withisLayerCancelledErrorand do not treat cancel as user “No”.Test plan
bun testlayerStack / layerGroup / live-actions cancel pathsdocs:check --isolatedSummary by CodeRabbit
New Features
cancelAllsupport for clearing layer stacks.LayerCancelledErrorwhen cancelled during teardown, parent dismissal, group disposal, or disconnect.isLayerCancelledErrorfor handling cancellation safely.Documentation