Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:electron: Copy budget files to succeed even if cleanup fails & adding retries #4507

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/desktop-electron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,25 @@ ipcMain.handle(

await copy(currentBudgetDirectory, newDirectory, {
overwrite: true,
preserveTimestamps: true,
});
await remove(currentBudgetDirectory);
} catch (error) {
logMessage(
'error',
`There was an error moving your directory: ${error}`,
);
throw error;
}

try {
await remove(currentBudgetDirectory);
} catch (error) {
// Fail silently. The move worked, but the old directory wasn't cleaned up - most likely a permission issue.
// This call needs to succeed to allow the user to continue using the app with the files in the new location.
logMessage(
'error',
`There was an error removing the old directory: ${error}`,
);
}
},
);
6 changes: 6 additions & 0 deletions upcoming-release-notes/4507.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MikesGlitch]
---

Allow desktop app to move budget files even when cleanup tasks fail