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

🐛 (api) fix performing api operations for local e2e encrypted files #2698

Merged
merged 3 commits into from May 15, 2024

Conversation

MatissJanis
Copy link
Member

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

Copy link

netlify bot commented May 3, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 7b75f3c
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/663e68d49599080008b85fa0
😎 Deploy Preview https://deploy-preview-2698.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@MatissJanis MatissJanis marked this pull request as ready for review May 3, 2024 16:28
Copy link
Contributor

github-actions bot commented May 3, 2024

Bundle Stats — desktop-client

Hey 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

Files count Total bundle size % Changed
9 4.71 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 20.53 kB 0%
static/js/narrow.js 59.81 kB 0%
static/js/wide.js 262.4 kB 0%
static/js/ReportRouter.js 1.23 MB 0%
static/js/index.js 3 MB 0%

Copy link
Contributor

github-actions bot commented May 3, 2024

Bundle Stats — loot-core

Hey 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

Files count Total bundle size % Changed
1 1.2 MB → 1.2 MB (+103 B) +0.01%
Changeset
File Δ Size
packages/loot-core/src/server/api.ts 📈 +390 B (+2.24%) 16.97 kB → 17.35 kB
packages/loot-core/src/server/main.ts 📈 +131 B (+0.21%) 59.82 kB → 59.95 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.2 MB → 1.2 MB (+103 B) +0.01%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@MatissJanis MatissJanis added the 🔍 Ready for Review Pull Request is not reviewed yet label May 4, 2024
Copy link
Contributor

@twk3 twk3 left a 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. 🚀

@trafico-bot trafico-bot bot added ✅ Approved Pull Request has been approved and can be merged and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 15, 2024
@MatissJanis MatissJanis merged commit 2d1abf4 into master May 15, 2024
19 checks passed
@MatissJanis MatissJanis deleted the matiss/fix-e2e-api branch May 15, 2024 16:10
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved Pull Request has been approved and can be merged labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants