fix: implement localStorage namespace isolation for multiple instances#8236
Open
vhenckel wants to merge 6 commits intonasa:masterfrom
Open
fix: implement localStorage namespace isolation for multiple instances#8236vhenckel wants to merge 6 commits intonasa:masterfrom
vhenckel wants to merge 6 commits intonasa:masterfrom
Conversation
- Add NamespacedLocalStorage utility to wrap localStorage with namespace prefixing - Auto-generate unique namespace per MCT instance (persisted in sessionStorage) - Update StoragePersistence to use namespaced localStorage - Update UserAPI to initialize StoragePersistence with namespaced storage - Update LocalStorageObjectProvider to accept optional namespaced storage - Update LocalStorage plugin to use instance's namespaced storage - Update pluginSpec tests to work with namespaced storage - Maintain backward compatibility with existing code Fixes nasa#8206 This ensures multiple Open MCT instances on the same host/port don't conflict in localStorage while maintaining backward compatibility.
7 tasks
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8206
Describe your changes:
This PR implements automatic namespace isolation for localStorage operations in Open MCT to resolve LocalStorage contention issues when multiple instances run on the same host/port.
Summary of Changes:
Created
NamespacedLocalStorageutility (src/utils/NamespacedLocalStorage.js):Updated
MCTclass (src/MCT.js):namespaceparameter to constructorgetNamespacedLocalStorage()methodUpdated
StoragePersistence(src/api/user/StoragePersistence.js):namespacedLocalStoragein constructorUpdated
UserAPI(src/api/user/UserAPI.js):StoragePersistencewith namespaced localStorage instanceUpdated
LocalStorageObjectProvider(src/plugins/localStorage/LocalStorageObjectProvider.js):namespacedLocalStorageparameterUpdated LocalStorage plugin (
src/plugins/localStorage/plugin.js):Key Features:
How It Works:
mct-1768601842155-123456)Testing:
All Submissions:
Author Checklist
type:label? Note: this is not necessarily the same as the original issue.