Commit b0a00d7
committed
fix(chat): the startup open cannot become an unhandled rejection
Review on #76. `revealChatAtStartup()` is async and nothing awaits the timer, so a
rejection from createWebviewPanel or from the focus command would surface as an unhandled
rejection in the extension host — noisy, and attributed to nothing in particular.
Caught, but LOGGED rather than swallowed. A chat that never appears with no trace of why
is the exact failure this setting exists to make explicable; `.catch(() => {})` would have
answered the review and made the product worse. The window still starts and both surfaces
stay openable by hand.
The same defect was in moveChatToSidebar, which I wrote in this PR — but it wants the
OPPOSITE treatment. That one is an explicit click, and `registerCommand` awaits whatever
the handler returns, so the reveal is now RETURNED: a failure reaches the user as a failed
command instead of leaving them pressing a button that does nothing. Silence is right for
an implicit startup action and wrong for a deliberate one.
Guards, each bypass-verified by reverting the fix:
- the .catch removed (the reviewer's bug, restored) — caught
- caught but swallowed with no dbg — caught
- move-back firing and forgetting again — caught
- the registration dropping the returned promise, which would make returning it pointless
NOT swept into this commit: seven other bare `executeCommand('levelcodeAi.chat.focus')`
calls predate this PR and have the same shape. Rewriting unrelated call sites inside a
review fix would bury the change under a diff nobody asked for; filed separately.
21 tests in chatSurface, 32 suites green.1 parent 9378f05 commit b0a00d7
2 files changed
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2310 | 2310 | | |
2311 | 2311 | | |
2312 | 2312 | | |
2313 | | - | |
| 2313 | + | |
2314 | 2314 | | |
2315 | | - | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
2316 | 2321 | | |
2317 | 2322 | | |
2318 | 2323 | | |
| |||
2788 | 2793 | | |
2789 | 2794 | | |
2790 | 2795 | | |
2791 | | - | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
2792 | 2805 | | |
2793 | 2806 | | |
2794 | 2807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
269 | 291 | | |
270 | 292 | | |
271 | 293 | | |
| |||
0 commit comments