[PR #3717] [MERGED] Fix race condition #5017

Closed
opened 2026-02-28 21:04:43 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3717
Author: @MikesGlitch
Created: 10/23/2024
Status: Merged
Merged: 10/23/2024
Merged by: @MikesGlitch

Base: masterHead: fix-race-condition


📝 Commits (2)

📊 Changes

2 files changed (+7 additions, -1 deletions)

View changed files

📝 packages/loot-core/src/server/main.ts (+1 -1)
upcoming-release-notes/3717.md (+6 -0)

📄 Description

This was noticed as a result of https://github.com/actualbudget/actual/pull/3310

To replicate: On electron, connect to a server and download a budget. It should error and wipe your global-store.json.

The issue: After downloading and doing the initial sync the budget gets closed - when the budget/db is closed we can't to further actions against the db. The sync opertaion is being listened to by the new functionality and performs DB updates. If your compy is slow it will attempt those updates when the db is closed..

Somehow during that process the global-store.json is wiped which leaves the user in a unrecoverable state.

My fix is to remove the close-budget call from the downloadbudget functionality. I don't think it's required for anything - I can't see why you'd want to close the budget after downloading and syncing.

This fix leaves the db open after downloading which would happen anyway because it gets loaded after downloading. It also performs a bit better.

Some people have reported the app hanging when downloading budget. This should fix that as well.


🔄 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/3717 **Author:** [@MikesGlitch](https://github.com/MikesGlitch) **Created:** 10/23/2024 **Status:** ✅ Merged **Merged:** 10/23/2024 **Merged by:** [@MikesGlitch](https://github.com/MikesGlitch) **Base:** `master` ← **Head:** `fix-race-condition` --- ### 📝 Commits (2) - [`ba7cae9`](https://github.com/actualbudget/actual/commit/ba7cae9c67ddfbf3672cf41db042ca33af563ddd) fix race condition - [`bc8201a`](https://github.com/actualbudget/actual/commit/bc8201a782f58a5eec3ab3bc76c5ed4ac15c2a9e) release notes ### 📊 Changes **2 files changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/main.ts` (+1 -1) ➕ `upcoming-release-notes/3717.md` (+6 -0) </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes --> This was noticed as a result of https://github.com/actualbudget/actual/pull/3310 **To replicate**: On electron, connect to a server and download a budget. It should error and wipe your global-store.json. The issue: After downloading and doing the initial sync the budget gets closed - when the budget/db is closed we can't to further actions against the db. The sync opertaion is being listened to by the new functionality and performs DB updates. If your compy is slow it will attempt those updates when the db is closed.. Somehow during that process the global-store.json is wiped which leaves the user in a **unrecoverable state.** My fix is to remove the close-budget call from the downloadbudget functionality. I don't think it's required for anything - I can't see why you'd want to close the budget after downloading and syncing. This fix leaves the db open after downloading which would happen anyway because it gets loaded after downloading. It also performs a bit better. Some people have reported the app hanging when downloading budget. This should fix that as well. --- <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-02-28 21:04:43 -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#5017