Improve dashboard motion and server stop status - #76
Conversation
| const finishStopped = async () => { | ||
| if (settled) return; | ||
| settled = true; | ||
| clearTimeout(timeout); |
There was a problem hiding this comment.
WARNING: timeout is read before TypeScript can prove it is assigned.
finishStopped reads timeout via clearTimeout(timeout), but the variable is declared without an initializer and assigned later in the same function. With strict definite assignment enabled, this can fail typechecking; defensively it should be nullable and cleared only when set.
| // Clear the ngrok URL from server record when server stops | ||
| updateServerSettings(serverId, { ngrokUrl: undefined }).catch(() => {}); | ||
| await updateServerSettings(serverId, { ngrokUrl: undefined }).catch(() => {}); | ||
| await updateServerStatus(serverId, "Offline", "0/20"); |
There was a problem hiding this comment.
CRITICAL: Missing error handling can leave stopServer unresolved.
finishStopped is async and is called without await. If updateServerStatus rejects, the async function rejects before reaching resolve, so the stopServer Promise can remain pending forever. Make persistence updates non-throwing before resolving, for example by catching them or using Promise.allSettled before calling resolve.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (7 files)
Fix these issues in Kilo Cloud Reviewed by nex-n2-pro:free · 682,175 tokens |
No description provided.