-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
auditCodebase audit findingCodebase audit findingbugSomething isn't workingSomething isn't workingerror-handlingError handling gapError handling gap
Description
Problem
File: src/hooks/useFileShortcuts.ts, lines 126 and 136
// Line 126
handleSaveAs(windowLabel); // returns Promise, no await or .catch()
// Line 136
handleSave(windowLabel); // returns Promise, no await or .catch()Both handleSaveAs and handleSave are async functions that return Promises, but they're called without await, void, or .catch() inside a synchronous keydown event handler. Any rejection from these functions (e.g., Tauri invoke failure, filesystem error) becomes an unhandled promise rejection.
This is particularly dangerous because handleSaveAs calls moveTabToNewWorkspaceWindow which can close the current tab/window — if the async chain fails partway through, the user gets no feedback.
Impact
- Unhandled promise rejections in the browser runtime
- Silent failures during save operations — user thinks save succeeded when it didn't
- Related to [audit] error-handling: Unhandled invoke() rejection in moveTabToNewWorkspaceWindow can cause data loss #320 (the invoke within
moveTabToNewWorkspaceWindow)
Suggested Fix
void handleSaveAs(windowLabel).catch((e) =>
console.error("[FileOps] Save As failed:", e)
);
void handleSave(windowLabel).catch((e) =>
console.error("[FileOps] Save failed:", e)
);Or better, show a toast notification on failure so the user knows their save didn't complete.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
auditCodebase audit findingCodebase audit findingbugSomething isn't workingSomething isn't workingerror-handlingError handling gapError handling gap