Walletwasabi: Wasabi stores state in incorrect directory path on macOS

Created on 9 Jul 2020  路  19Comments  路  Source: zkSNACKs/WalletWasabi

General Description

On macOS, Wasabi stores state in $HOME/.walletwasabi. The correct location for application state on macOS is $HOME/Library/Application Support/Wasabi Wallet.

How To Reproduce?

  1. Launch Wasabi Wallet

Operating System

macOS

Wasabi Version

1.1.10.2

debug featurenhancement

All 19 comments

fwiw, it is $HOME/.walletwasabi on linux...

FWIW it's supposed to be ${XDG_CONFIG_HOME:-$HOME/.config}/walletwasabi on linux. This means it should be defaulting to $HOME/.config/walletwasabi in the case where the user has not set $XDG_CONFIG_HOME to something else.

https://wiki.archlinux.org/index.php/XDG_Base_Directory

Oh, I see @sneak, thanks.

However, there are some apps that keep the state in the home directory, like for example ~/.gnupg.

I don't know why / how this is different, good or bad...

@MaxHillebrand adhering to XDG standard is better since it makes it less cluttery on the homedir of the user...

This thread aside, GnuPG is not a very good example of well-designed or well-behaved software. Most of its fundamental decisions are rooted in thinking that's >20 years old, including oftentimes ones that could and should have been revisited since.

The majority of well-behaved desktop software supports and respects XDG.

ok, so probably if we do Wasabi from scratch, it should follow XDG.

however, currently it does not. then the question is, should we break the current implementation and user expectation in order to switch to follow XDG?

we perhaps could just detect both directories and default to the xdg one if there isnt any prior config dirs yet

oh... actually... we might use the upcoming hardfork to enforce the move to .config/walletwasabi/? so all users have it the same again.

If the directory is being created for the first time, use XDG (or the appropriate directory on macOS). If there is an existing one in the old location and there isn鈥檛 one in the correct new location, just move it on launch.

On my mac .config folder contains mainly config or XML files only.

$HOME/Library/Application Support/Wasabi Wallet is user-dependent?

Moving the whole folder can cause a lot of problems for us - like what if I can move only half of the folder because something is used by other processes, that would break the software. So I am generally against this if there are no issues regarding this. I found many other Softwares doing the same as we are doing now, like Nuget, VSCode.

$HOME/.walletwasabi is user-dependent as well. It's extremely unlikely that anything other than Wasabi is accessing files in ~/.walletwasabi. Additionally, if the move fails, you can handle the error appropriately. In any case, on new installs, it should be putting the application state in the correct place, and should do the right thing on first startup on systems that do not have either directory.

The fact that other software also has this bug is not a reason to persist in doing the wrong thing on a platform for which you target.

It's interesting that you site VSCode, a software package that contains pervasive spyware, as an engineering role model for software that is designed to protect user privacy.

It's interesting that you site VSCode, a software package that contains pervasive spyware, as an engineering role model for software that is designed to protect user privacy.

How does this affects Wasabi? Can you elaborate on that?

The fact that other software also has this bug is not a reason to persist in doing the wrong thing on a platform for which you target.

Your reasoning is right if you consider apple as a divine source of truth. We are not following many of their rules because they are not caring about anything that is not apple. For example .NET Core apps cannot be packaged correctly because they set up a folder structure inside the APP that can only be satisfied by their XCode apps.

This has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Your reasoning is right if you consider apple as a divine source of truth

It's not Apple's "divine source of truth" that says that on macOS, application settings and state go in ~/Library/Application Support/$APPNAME. That's the platform convention, same as putting files under $HOME (or, these days, XDG directories) on Linux.

To ignore the platform's conventions is to produce buggy software that violates user expectations. You can, of course, as a userspace program write files wherever you like, but that makes your program relatively shoddy.

Future versions of macOS may end up prohibiting arbitrary file writes outside of defined and expected program directories, FWIW.

This has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Don't go all CADT on me. Wasabi still stores state the incorrect directory on macOS.

What's the point of a bugtracker if you just throw away the bugs that aren't being worked on?

Having the reporter of a bug have to take an action to keep a still-valid bug from being autoclosed is a terrible UX.

Staling is a good UX as it brings attention to the forgotten issues from time to time. I added a label, now it won't be stale again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yahiheb picture yahiheb  路  3Comments

MaxHillebrand picture MaxHillebrand  路  3Comments

UkolovaOlga picture UkolovaOlga  路  3Comments

2pac1 picture 2pac1  路  3Comments

yahiheb picture yahiheb  路  3Comments