Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

reset preferences when creating a new wallet #350

Closed
mackuba opened this issue Apr 1, 2014 · 4 comments
Closed

reset preferences when creating a new wallet #350

mackuba opened this issue Apr 1, 2014 · 4 comments

Comments

@mackuba
Copy link
Member

mackuba commented Apr 1, 2014

If for some reason the user clears the data directory but leaves the preferences file in place and starts Hive again, then the new wallet file starts backing up to Dropbox to the same place as the old one, overwriting the old one.

@nschum
Copy link
Contributor

nschum commented Apr 13, 2014

We could generate a UUID and put it in the Application Support directory, preferences and backups (so we never overwrite a non-matching backup, cf. #353). The UUID could probably be the wallet's public address for now.

@nschum
Copy link
Contributor

nschum commented Apr 13, 2014

In fact, why reset the preferences? We could just extend backup to support multiple wallets per location.

@ghost
Copy link

ghost commented Apr 13, 2014

This should be a high-priority fix IMO.

@mackuba
Copy link
Member Author

mackuba commented Apr 15, 2014

We could generate a UUID and put it in the Application Support directory, preferences and backups (so we never overwrite a non-matching backup, cf. #353). The UUID could probably be the wallet's public address for now.

We're already doing it for the backups, e.g. wallet 1abcdefgh backs up to Hive-1abcd, and if you delete everything and create a new wallet 1mnopqrst it backs up to Hive-1mnop. The problem is that the backup location is set only if it isn't already set, and if it is for some reason (like described above), then the new wallet starts backing up in the wrong folder. Apps like AppCleaner are supposed to delete the Application Support and Preferences together, but if you're doing this manually you can miss one of them.

Using UUIDs/prefixes in Application Support / Preferences implies that we support multiple Hive wallets coexisting on the disk at the same time. That could be useful for some users, but I'm afraid it would also cause a lot of confusion for others, so let's leave that as an idea for the future for now.

In fact, why reset the preferences? We could just extend backup to support multiple wallets per location.

There's no reason for Preferences to remember the "Hive-1abcd" directory at all if the "1abcdefgh" wallet no longer exists in Application Support, because there's nothing to back up anymore. Of course the backup will stay there and "Hive-1mnop" will be created alongside the old one, but the location should be removed from the Preferences and only the new wallet should be backed up to the new location (since only the new wallet exists at this point).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants