fix(desktop): prevent unhandled rejection in cloud status refresh#539
fix(desktop): prevent unhandled rejection in cloud status refresh#539
Conversation
…led rejections refreshCloudStatus catches controller-unreachable errors and updates UI state correctly, but then re-throws the error. Since all callers (window focus, visibility change, polling interval) use fire-and-forget via `void`, the re-thrown error becomes an unhandled promise rejection captured by Sentry as NEXU-DESKTOP-PROD-B. Closes #535
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe change removes error propagation from the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
/cr |
|
✅ CR topic created in Feishu topic group Refly CR. |
What
Remove erroneous
throw errorfromrefreshCloudStatusthat caused unhandled promise rejections when the controller is temporarily unreachable.Why
Sentry issue NEXU-DESKTOP-PROD-B — 12 occurrences since v0.1.6. Every window focus, tab switch, or 2-second polling cycle during cloud connect produced an unhandled rejection when the controller was down. Closes #535
How
refreshCloudStatus()already handles the error correctly by settingcloudStatusPhase("error")and displaying a user-facing message. Thethrow errorat the end of the catch block is unnecessary — all three callers invoke it fire-and-forget (void refreshCloudStatus(...)), so the re-thrown error has no consumer and surfaces as an unhandled rejection.Removed the
throw errorline. No behavior change for the user — the error UI already renders properly without it.Affected areas
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpassespnpm generate-typesrun (if API routes/schemas changed)anytypes introduced (useunknownwith narrowing)Summary by CodeRabbit