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

fix: migration from localstorage to idb #608

Merged
merged 2 commits into from Aug 12, 2022

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Aug 12, 2022

Description

To migrate from localstorage to idb, AuthClient tries to find current values in the storage with the incorrect keys - i.e it tries to load icdelegation and icidentity instead of ic-delegation and ic-identity and therefore, no session are found and migrated.

This is because a LocalStorage object is initialized with the prefix ic instead of ic-.

How Has This Been Tested?

I tried to bump agent-js from v0.12.0 v0.13.0 in my project cycles.watch locally and noticed that I lost my session. Then debugged and found the prefix mismatch.

Reference

This PR is a follow-up to PR #606 and release of agent-js v0.13.0 (changelog)

Open questions

All consumers used to inherits prefix ic- or was it an option? If it was a variable that can be set by the developers, then the migration should be extended with such param as well.

@peterpeterparker peterpeterparker requested a review from a team as a code owner August 12, 2022 06:05
@krpeacock krpeacock merged commit bbcb687 into main Aug 12, 2022
@krpeacock krpeacock deleted the fix/migration-localstorage-idb branch August 12, 2022 15:56
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

Successfully merging this pull request may close these issues.

None yet

2 participants