[GH-ISSUE #596] [Bug]: old budget files getting deleted #49368

Closed
opened 2026-04-30 10:42:45 -05:00 by GiteaMirror · 12 comments
Owner

Originally created by @MatissJanis on GitHub (Jan 30, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/596

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

https://actualbudget.netlify.app/

  1. create a test file (with demo data)
  2. close
  3. create a new EMPTY file
  4. close
  5. open the new DEMO file
  6. it's empty 🤔

This issue might exist only in the offline version of the product. It might not exist in the versions that sync files with a backend server. Either way - this is a pretty bad bug that we should address ASAP.

What error did you receive?

Previous budget files get deleted when a new one is created.

Where are you hosting Actual?

None

What browsers are you seeing the problem on?

No response

Operating System

None

Originally created by @MatissJanis on GitHub (Jan 30, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/596 ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? https://actualbudget.netlify.app/ 1. create a test file (with demo data) 2. close 3. create a new EMPTY file 4. close 5. open the new DEMO file 6. it's empty 🤔 **This issue might exist only in the offline version of the product. It _might_ not exist in the versions that sync files with a backend server.** Either way - this is a pretty bad bug that we should address ASAP. ### What error did you receive? Previous budget files get deleted when a new one is created. ### Where are you hosting Actual? None ### What browsers are you seeing the problem on? _No response_ ### Operating System None
GiteaMirror added the help wantedbug labels 2026-04-30 10:42:45 -05:00
Author
Owner

@j-f1 commented on GitHub (Jan 30, 2023):

I believe this may be an issue with Netlify not setting the COOP/COEP headers.

<!-- gh-comment-id:1409368906 --> @j-f1 commented on GitHub (Jan 30, 2023): I believe this may be an issue with Netlify not setting the COOP/COEP headers.
Author
Owner

@MatissJanis commented on GitHub (Jan 30, 2023):

Tested locally: yes, that seems to be working OK.

Also when deployed with actual-server that seems to be OK.

So possibly only Netlify affected. Which is good news. Phew..

<!-- gh-comment-id:1409392121 --> @MatissJanis commented on GitHub (Jan 30, 2023): Tested locally: yes, that seems to be working OK. Also when deployed with actual-server that seems to be OK. So possibly only Netlify affected. Which is good news. Phew..
Author
Owner

@TechwizEE commented on GitHub (Jan 31, 2023):

Tested master locally (yarn start:browser) with Firefox and Chrome
A. http://localhost:5006 the test budget and adding multiple new budget files works without issue
B. http://<serverIP>:5006 I see the issue described at the top

(updated) Debug console notables:

  • Firefox Error: Fallback mode unable to write file changes with test B
  • Chrome Cross-Origin-Opener-Policy header has been ignored... Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead with test B
<!-- gh-comment-id:1409635421 --> @TechwizEE commented on GitHub (Jan 31, 2023): Tested `master` locally (`yarn start:browser`) with Firefox and Chrome A. `http://localhost:5006` the test budget and adding multiple new budget files works without issue B. `http://<serverIP>:5006` I see the issue described at the top (updated) Debug console notables: - Firefox `Error: Fallback mode unable to write file changes` with test B - Chrome `Cross-Origin-Opener-Policy header has been ignored... Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead` with test B
Author
Owner

@TechwizEE commented on GitHub (Jan 31, 2023):

Also tried tag v23.1.12 on actual-server, performed the A/B tests again, saw the same result I reported just above.

<!-- gh-comment-id:1409647725 --> @TechwizEE commented on GitHub (Jan 31, 2023): Also tried tag `v23.1.12` on `actual-server`, performed the A/B tests again, saw the same result I reported just above.
Author
Owner

@trevdor commented on GitHub (Jan 31, 2023):

Dug through old Netlify deploys. One pattern I noticed:

Every deploy of master (https://master--actualbudget.netlify.app/) that I checked exhibited the buggy behavior, back to December.

Preview deploys do not exhibit the bug (e.g. the very recent build https://deploy-preview-602--actualbudget.netlify.app/)

🤔

<!-- gh-comment-id:1409773809 --> @trevdor commented on GitHub (Jan 31, 2023): Dug through old Netlify deploys. One pattern I noticed: Every deploy of `master` (`https://master--actualbudget.netlify.app/`) that I checked exhibited the buggy behavior, back to December. Preview deploys do not exhibit the bug (e.g. the very recent build `https://deploy-preview-602--actualbudget.netlify.app/`) 🤔
Author
Owner

@j-f1 commented on GitHub (Jan 31, 2023):

Yep, it was an issue where the _headers file was getting deleted during the build. I changed the config on the backend so future builds will no longer have this issue.

<!-- gh-comment-id:1410282829 --> @j-f1 commented on GitHub (Jan 31, 2023): Yep, it was an issue where the `_headers` file was getting deleted during the build. I changed the config on the backend so future builds will no longer have this issue.
Author
Owner

@MatissJanis commented on GitHub (Jan 31, 2023):

Even though this was fixed for Netlify, I'll re-open it. IMO we need to address the problem that sometimes a budget file can be unintentionally deleted because of misconfiguration.

So we should 1) identify if creating a budget file will corrupt other existing files and 2) show a warning message OR perhaps even disable creating a new file.

<!-- gh-comment-id:1410801332 --> @MatissJanis commented on GitHub (Jan 31, 2023): Even though this was fixed for Netlify, I'll re-open it. IMO we need to address the problem that _sometimes_ a budget file can be unintentionally deleted because of misconfiguration. So we should 1) identify if creating a budget file will corrupt other existing files and 2) show a warning message OR perhaps even disable creating a new file.
Author
Owner

@MatissJanis commented on GitHub (Jan 31, 2023):

Even though this was fixed for Netlify, I'll re-open it. IMO we need to address the problem that sometimes a budget file can be unintentionally deleted because of misconfiguration.

So we should 1) identify if creating a budget file will corrupt other existing files and 2) show a warning message OR perhaps even disable creating a new file.

<!-- gh-comment-id:1410801806 --> @MatissJanis commented on GitHub (Jan 31, 2023): Even though this was fixed for Netlify, I'll re-open it. IMO we need to address the problem that _sometimes_ a budget file can be unintentionally deleted because of misconfiguration. So we should 1) identify if creating a budget file will corrupt other existing files and 2) show a warning message OR perhaps even disable creating a new file.
Author
Owner

@j-f1 commented on GitHub (Feb 3, 2023):

#600 should handle this, right?

<!-- gh-comment-id:1416412359 --> @j-f1 commented on GitHub (Feb 3, 2023): #600 should handle this, right?
Author
Owner

@MatissJanis commented on GitHub (Feb 3, 2023):

#600 should handle this, right?

There are three cases when budget files get deleted without people noticing (AFAIK):

  1. missing SharedArrayBuffer support
  2. lacking Cross-Origin-Opener-Policy headers
  3. http vs https (haven't looked into this much myself, but this keep popping up as a bug report pattern)

With #600 we solved only (1) IMO. Still need to figure out how we can identify (2) and (3)

<!-- gh-comment-id:1416415139 --> @MatissJanis commented on GitHub (Feb 3, 2023): > #600 should handle this, right? There are three cases when budget files get deleted without people noticing (AFAIK): 1. missing SharedArrayBuffer support 2. lacking Cross-Origin-Opener-Policy headers 3. http vs https (haven't looked into this much myself, but this keep popping up as a bug report pattern) With #600 we solved only (1) IMO. Still need to figure out how we can identify (2) and (3)
Author
Owner

@j-f1 commented on GitHub (Feb 3, 2023):

2 and 3 cause 1. The underlying issue is — just like with #511 — that SharedArrayBuffer is disabled when the headers or secure context are missing (because of Rowhammer/Meltdown/Spectre). So checking for missing SharedArrayBuffer should be catching all the possible cases.

<!-- gh-comment-id:1416425494 --> @j-f1 commented on GitHub (Feb 3, 2023): 2 and 3 cause 1. The underlying issue is — just like with #511 — that SharedArrayBuffer is disabled when the headers or secure context are missing (because of Rowhammer/Meltdown/Spectre). So checking for missing SharedArrayBuffer should be catching all the possible cases.
Author
Owner

@MatissJanis commented on GitHub (Feb 3, 2023):

Looks like you're right. Tested here: https://github.com/actualbudget/actual/pull/619

Thanks @j-f1 ! Great job as always!

<!-- gh-comment-id:1416431158 --> @MatissJanis commented on GitHub (Feb 3, 2023): Looks like you're right. Tested here: https://github.com/actualbudget/actual/pull/619 Thanks @j-f1 ! Great job as always!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#49368