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

Closed
opened 2026-04-10 21:02:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/2698
Author: @MatissJanis
Created: 5/3/2024
Status: Merged
Merged: 5/15/2024
Merged by: @MatissJanis

Base: masterHead: matiss/fix-e2e-api


📝 Commits (3)

  • 7aaa062 🐛 (api) fix performing api operations for local e2e encrypted files
  • c25f9ca Release notes
  • 7b75f3c Merge branch 'master' into matiss/fix-e2e-api

📊 Changes

4 files changed (+51 additions, -24 deletions)

View changed files

📝 packages/loot-core/src/server/api.ts (+41 -24)
📝 packages/loot-core/src/server/main.ts (+3 -0)
📝 packages/loot-core/src/types/budget.d.ts (+1 -0)
upcoming-release-notes/2698.md (+6 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/2698 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 5/3/2024 **Status:** ✅ Merged **Merged:** 5/15/2024 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `matiss/fix-e2e-api` --- ### 📝 Commits (3) - [`7aaa062`](https://github.com/actualbudget/actual/commit/7aaa062f49f82f9f93652693c1b2f7fd5377f98b) :bug: (api) fix performing api operations for local e2e encrypted files - [`c25f9ca`](https://github.com/actualbudget/actual/commit/c25f9cadc6a2e6ddb0179adf5cec782f0f6935f6) Release notes - [`7b75f3c`](https://github.com/actualbudget/actual/commit/7b75f3c4d7983141669bff3d2c293f49d484f98f) Merge branch 'master' into matiss/fix-e2e-api ### 📊 Changes **4 files changed** (+51 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/api.ts` (+41 -24) 📝 `packages/loot-core/src/server/main.ts` (+3 -0) 📝 `packages/loot-core/src/types/budget.d.ts` (+1 -0) ➕ `upcoming-release-notes/2698.md` (+6 -0) </details> ### 📄 Description 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_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-10 21:02:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#11517