[PR #2698] 🐛 (api) fix performing api operations for local e2e encrypted files #4462

Closed
opened 2026-02-28 20:56:10 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/2698

State: closed
Merged: Yes


Originally discovered in: https://github.com/actualbudget/actual/pull/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

**Original Pull Request:** https://github.com/actualbudget/actual/pull/2698 **State:** closed **Merged:** Yes --- Originally discovered in: https://github.com/actualbudget/actual/pull/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_
GiteaMirror added the pull-request label 2026-02-28 20:56:10 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4462