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-3803 add prefix to client storage #3806

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dillonstreator
Copy link
Contributor

@dillonstreator dillonstreator commented Jan 24, 2024

Fixes #3803

  • Enable surgical removal of Medplum-managed local storage keys to be friendlier to other systems that leverage local storage
  • Reduce likelihood of local storage key clashing with other systems

Warning

This is a breaking change for any client that depends on the local storage key names activeLogin & logins and as such should be highly visible in release notes.

@dillonstreator dillonstreator requested a review from a team as a code owner January 24, 2024 23:16
Copy link

vercel bot commented Jan 24, 2024

@dillonstreator is attempting to deploy a commit to the Medplum Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Jan 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medplum-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 2:01am
medplum-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 2:01am
medplum-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 2:01am

@dillonstreator
Copy link
Contributor Author

Test flake or did I break something 🤔
image

}

clear(): void {
this.storage.clear();
const keys = this.storage instanceof MemoryStorage ? this.storage.keys() : Object.keys(this.storage);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While Object.keys(this.storage) works for localStorage, this is not safe for any Storage implementation. Might need to create a new interface that extends Storage and adds a keys method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

94daee9 is an attempt at solving this issue

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

Successfully merging this pull request may close these issues.

Namespace Medplum-managed local storage keys
1 participant