Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing backup keeps old storage keys #1191

Open
marcustyphoon opened this issue Aug 12, 2023 · 1 comment · May be fixed by #1621
Open

Importing backup keeps old storage keys #1191

marcustyphoon opened this issue Aug 12, 2023 · 1 comment · May be fixed by #1621
Assignees
Labels
bug Something isn't working

Comments

@marcustyphoon
Copy link
Collaborator

Platform

MacOS 13.5 arm64

Browser

Chrome 115.0.5790.170

Addon version

master

Details

const parsedStorage = JSON.parse(importText);
await browser.storage.local.set(parsedStorage);

When one imports a backup of their preferences, any keys in the backup get set, but any keys not in the backup do not get removed, as one might expect. (adding await browser.storage.local.clear(); would implement this behavior.)

Of course, there are probably situations where one might want the current, merge-my-import-into-my-current-preferences behavior, honestly; one could argue that this is only sort of a bug. It would probably be way too confusing to implement two different restore buttons that allow the user to pick either behavior and that only appear in the case where the pasted backup does not contain some of the keys which are currently set, though it's not like it's hard.

@marcustyphoon marcustyphoon added the bug Something isn't working label Aug 12, 2023
@Charlignon
Copy link

What about clearing the storage every time and just adding a message like "this will override your existing configuration" in the import copy ?

@AprilSylph AprilSylph added the help wanted Extra attention is needed label Sep 6, 2023
@marcustyphoon marcustyphoon self-assigned this Sep 16, 2024
@marcustyphoon marcustyphoon removed the help wanted Extra attention is needed label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants