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

More resilient user settings #189

Open
OhKai opened this issue Dec 9, 2023 · 0 comments
Open

More resilient user settings #189

OhKai opened this issue Dec 9, 2023 · 0 comments

Comments

@OhKai
Copy link
Contributor

OhKai commented Dec 9, 2023

Describe the bug
If the user already has some user settings stored in their LocalStorage, any new default values won't be added. This leads to bugs on the site where some values are expected to exist in the settings store.

To Reproduce
Add a new default setting to lib/user-preferences.ts without deleting the LocalStorage and try to read it in a component.

Expected behavior
The website should always work, regardless if the user visited a long time ago and has very outdated LocalStorage data.
Ideally, even old settings should be migrated and not simply overwriten.

Additional context
There needs to be some migration code whenever we structurally change the settings. E.g. make sure to add new settings once and change structure of existing settings if types/props change.

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

No branches or pull requests

1 participant