[Bug]: Synced files don't belong in synced locations #1178

Closed
opened 2026-02-28 19:35:02 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @MikeBishop on GitHub (Jun 29, 2024).

Verified issue does not already exist?

  • I have searched and found no existing issue
  • I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file)

What happened?

Now that the desktop client is back, #317 is relevant again. The Actual Desktop client stores the files in Documents. However, the Documents folder is often a synced location under Windows; I presume other OSes do something similar. Having Windows/OneDrive syncing the files while Actual is also trying to sync the files is asking for trouble.

The right place to put files like this on Windows is %LOCALAPPDATA%, a location for data which Windows should maintain locally for the user without attempting to sync it.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Desktop App (Electron)

Operating System

Windows 11

Originally created by @MikeBishop on GitHub (Jun 29, 2024). ### Verified issue does not already exist? - [X] I have searched and found no existing issue - [X] I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file) ### What happened? Now that the desktop client is back, #317 is relevant again. The Actual Desktop client stores the files in Documents. However, the Documents folder is often a synced location under Windows; I presume other OSes do something similar. Having Windows/OneDrive syncing the files while Actual is also trying to sync the files is asking for trouble. The right place to put files like this on Windows is %LOCALAPPDATA%, a location for data which Windows should maintain locally for the user without attempting to sync it. ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Desktop App (Electron) ### Operating System Windows 11
GiteaMirror added the electronbug labels 2026-02-28 19:35:03 -06:00
Author
Owner

@MikesGlitch commented on GitHub (Jun 30, 2024):

This is a good point.

I've been wanting the ability to configure where the data directory and backup directory are located, maybe that deserves it's own ticket.

We could have a default, which would take the OS default and an override allowing you to put it somewhere else.

I use Google drive to sync but it's always one way for Actual so I don't get the conflicts.

@MikesGlitch commented on GitHub (Jun 30, 2024): This is a good point. I've been wanting the ability to configure where the data directory and backup directory are located, maybe that deserves it's own ticket. We could have a default, which would take the OS default and an override allowing you to put it somewhere else. I use Google drive to sync but it's always one way for Actual so I don't get the conflicts.
Author
Owner

@MikesGlitch commented on GitHub (Jul 25, 2024):

I have a partial fix for this here:

https://github.com/actualbudget/actual/pull/3133

We can't change where the files are for existing budgets - it would freak the user out if we started moving existing files without consent.

Instead we have this data dir location picker (visible on electron in the Settings page):
image

It will change the directory where Actual looks for the files. This should allow you to move your budget files to wherever you want (away from folders that may be synced).

In a future PR

We can change the default directory on Windows, and ensure existing budgets still look in the directory they were created in.

@MikesGlitch commented on GitHub (Jul 25, 2024): I have a partial fix for this here: https://github.com/actualbudget/actual/pull/3133 We can't change where the files are for existing budgets - it would freak the user out if we started moving existing files without consent. Instead we have this data dir location picker (visible on electron in the Settings page): ![image](https://github.com/user-attachments/assets/c1d9e01d-3134-4e38-941c-82a1fae0d3ea) It will change the directory where Actual looks for the files. This should allow you to move your budget files to wherever you want (away from folders that may be synced). ## In a future PR We can change the default directory on Windows, and ensure existing budgets still look in the directory they were created in.
Author
Owner

@MikesGlitch commented on GitHub (Sep 4, 2024):

I've changed my opinion on this. We've enabled the functionality to change the users data directory so I don't think this is a problem anymore.

The default location is the Documents directory, which is easy for the user to find and navigate to.

If we set the default directory to C:\Users\THEUSER\AppData\Local\Actual it would be much harder to find (AppData is a hidden folder and most people don't go digging in there).

I'm going to close this. If anyone feels like this is the wrong approach please comment and we can reopen & discuss.

@MikesGlitch commented on GitHub (Sep 4, 2024): I've changed my opinion on this. We've enabled the functionality to change the users data directory so I don't think this is a problem anymore. The default location is the ```Documents``` directory, which is easy for the user to find and navigate to. If we set the default directory to ```C:\Users\THEUSER\AppData\Local\Actual``` it would be much harder to find (AppData is a hidden folder and most people don't go digging in there). I'm going to close this. If anyone feels like this is the wrong approach please comment and we can reopen & discuss.
Author
Owner

@MikeBishop commented on GitHub (Sep 4, 2024):

I feel like the right answer depends on whether you're connected to a server or not. If you're running stand-alone, then the files should be somewhere user-accessible in case they want to relocate them. Documents is probably correct.

But if you're syncing from a server, the server is the authoritative copy and the local version is a cache / for temporary offline use. There's no need for the user to find these files on the client; only on the server. That's what belongs in AppData, and putting them in Documents is asking for sync errors.

Is it possible to flip the default based on whether Actual is using a server or not, perhaps?

@MikeBishop commented on GitHub (Sep 4, 2024): I feel like the right answer depends on whether you're connected to a server or not. If you're running stand-alone, then the files should be somewhere user-accessible in case they want to relocate them. Documents is probably correct. But if you're syncing from a server, the server is the authoritative copy and the local version is a cache / for temporary offline use. There's no need for the user to find these files on the client; only on the server. That's what belongs in AppData, and putting them in Documents is asking for sync errors. Is it possible to flip the default based on whether Actual is using a server or not, perhaps?
Author
Owner

@MikesGlitch commented on GitHub (Sep 4, 2024):

But if you're syncing from a server, the server is the authoritative copy and the local version is a cache / for temporary offline use.

Actual works in a "local first" way, so the local copy of the database is the authoritative copy. The server may or may not have the most up to date data. We'll always need the files on the Electron client - Electron doesn't use indexdb to store its data.

That's what belongs in AppData, and putting them in Documents is asking for sync errors

I don't see how syncing your Budget via OneDrive/whatever would cause sync errors. Even if your Document directory was being synced to the data directory on your server, there shouldn't be sync errors because the files are different.

Is it possible to flip the default based on whether Actual is using a server or not, perhaps?

I'm not sure this makes sense because of the point above.

I might be missing something, let me know.

@MikesGlitch commented on GitHub (Sep 4, 2024): > But if you're syncing from a server, the server is the authoritative copy and the local version is a cache / for temporary offline use. Actual works in a "local first" way, so the local copy of the database is the authoritative copy. The server may or **may not** have the most up to date data. We'll always need the files on the Electron client - Electron doesn't use indexdb to store its data. > That's what belongs in AppData, and putting them in Documents is asking for sync errors I don't see how syncing your Budget via OneDrive/whatever would cause sync errors. Even if your Document directory was being synced to the data directory on your server, there shouldn't be sync errors because the files are different. > Is it possible to flip the default based on whether Actual is using a server or not, perhaps? I'm not sure this makes sense because of the point above. I might be missing something, let me know.
Author
Owner

@MikeBishop commented on GitHub (Sep 4, 2024):

To be clear, it doesn't cause sync errors in Actual. It causes sync errors in OneDrive or whatever is syncing the files.

When Documents is being synced between two computers, each of which has a local copy of the file and can makes changes. If Actual is using a sync server, it can upload the changes to the server and fetch changes uploaded by other clients, folding the contents together through its own sync process. OneDrive will just create two copies of the file and tell you to go fix it.

I think my larger point is that if there's a sync server, you always want that server to be the one intermediating between clients; storing the file in a synced location has a third-party who can't interpret the file doing that instead. Better than nothing, but worse than a sync server.

@MikeBishop commented on GitHub (Sep 4, 2024): To be clear, it doesn't cause sync errors _in Actual_. It causes sync errors in OneDrive or whatever is syncing the files. When Documents is being synced between two computers, each of which has a local copy of the file and can makes changes. If Actual is using a sync server, it can upload the changes to the server and fetch changes uploaded by other clients, folding the contents together through its own sync process. OneDrive will just create two copies of the file and tell you to go fix it. I think my larger point is that if there's a sync server, you always want that server to be the one intermediating between clients; storing the file in a synced location has a third-party who can't interpret the file doing that instead. Better than nothing, but worse than a sync server.
Author
Owner

@MikesGlitch commented on GitHub (Sep 4, 2024):

Ahh OK, I see what you mean now. You've got two syncs going on - Actual's server sync and another file system sync. If two clients are running at the same time and listening to the file system sync while also syncing to Actual Server you get conflicts.

OK I'm torn. This seems like an edge case but your saying that OneDrive two-way syncs the Documents directory by default?

If so, that's annoying and might catch out non-techie users if they run Actual on multiple clients with OneDrive syncing.

I still don't like the idea of putting the users budget in the hidden AppData folder.

I can see a middle ground here. Maybe the solution is to prompt the user when they first create the budget asking "Where would you like to store this budget?". They select a file location, and we warn them about the dangers of using both file system sync and the server sync at the same time. And the dangers of using file system sync at all for that matter.

This would require a bit of work because currently all budgets are stored in the same folder.

If you're happy with this and think it'll solve the issue, I can create a new feature request.

@MikesGlitch commented on GitHub (Sep 4, 2024): Ahh OK, I see what you mean now. You've got two syncs going on - Actual's server sync and another file system sync. If two clients are running at the same time and listening to the file system sync while also syncing to Actual Server you get conflicts. OK I'm torn. This seems like an edge case but your saying that OneDrive two-way syncs the Documents directory by default? If so, that's annoying and might catch out non-techie users if they run Actual on multiple clients with OneDrive syncing. I still don't like the idea of putting the users budget in the hidden AppData folder. I can see a middle ground here. Maybe the solution is to prompt the user when they first create the budget asking "Where would you like to store this budget?". They select a file location, and we warn them about the dangers of using both file system sync and the server sync at the same time. And the dangers of using file system sync at all for that matter. This would require a bit of work because currently all budgets are stored in the same folder. If you're happy with this and think it'll solve the issue, I can create a new feature request.
Author
Owner

@MikeBishop commented on GitHub (Sep 5, 2024):

Yes, I think that would cover it. A few thoughts on that approach:

  • I doubt this needs to change the "all budgets are stored in one place" behavior. Users are likely to consistently use one mode or the other, so keeping that consistency seems reasonable. This seems similar to server selection -- something we ask the user on first run, assume will stay constant, but it's possible to change later if need be.
  • Given that users don't really know what AppData is, and that the concept would vary between OSes, maybe we present it with terms like "private storage" versus "with your Documents", and then have a Custom option in the corner if they really want somewhere else.
  • I still think that private storage / Local AppData is the most reasonable default for users working with a sync server and Documents is fine otherwise. Perhaps this should come after the initial server selection, and be presented as "We've defaulted here; OK or Change?"
@MikeBishop commented on GitHub (Sep 5, 2024): Yes, I think that would cover it. A few thoughts on that approach: - I doubt this needs to change the "all budgets are stored in one place" behavior. Users are likely to consistently use one mode or the other, so keeping that consistency seems reasonable. This seems similar to server selection -- something we ask the user on first run, assume will stay constant, but it's possible to change later if need be. - Given that users don't really know what AppData is, and that the concept would vary between OSes, maybe we present it with terms like "private storage" versus "with your Documents", and then have a Custom option in the corner if they really want somewhere else. - I still think that private storage / Local AppData is the most reasonable default for users working with a sync server and Documents is fine otherwise. Perhaps this should come after the initial server selection, and be presented as "We've defaulted here; OK or Change?"
Author
Owner

@MikesGlitch commented on GitHub (Sep 5, 2024):

Cool, I've made the feature request here: https://github.com/actualbudget/actual/issues/3371

Feel free to provide feedback on the ticket & vote up!

@MikesGlitch commented on GitHub (Sep 5, 2024): Cool, I've made the feature request here: https://github.com/actualbudget/actual/issues/3371 Feel free to provide feedback on the ticket & vote up!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#1178