-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
🐛 (api) fix performing api operations for local e2e encrypted files #2698
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged No assets were unchanged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and I confirmed this fixed the issue when syncing a budget file from the api that is encrypted, and already cached locally. 🚀
Originally discovered in: #2683
However, because this is fundamentally different issue - it makes more sense to separate it out into its own PR.
The problem: this only affects budgets that are using the server and that are e2e encrypted.
The initial load of the e2e budget works fine. It downloads the file, decrypts it and stores it locally. But then the subsequent run might fail.
This is because on subsequent runs we no longer download the entire file. We use the local file and just sync the changes with the server. However, this requires the encryption key to be set. And encryption key was ONLY set for the initial run. it was not set for subsequent runs.
Thus it resulted in the API script breaking.
--
The fix is relatively simple: set the encryption key even always. Even if the remote file was already downloaded.
But this required a small amount of refactoring to make the code cleaner