feat(storage): implement user-scoped data storage#66
Merged
Conversation
Isolate user data (notes, captures, briefings, etc.) per logged-in Hub account:
- Add UserSessionManager to track login/logout and emit session change events
- Add UserDataResolver to compute user-scoped paths (users/{userId}/)
- Add UserDataMigrator to copy existing data on first login
- Add ReinitializableService interface for user-scoped services
- Update 10 services to implement reinitialize/clearState pattern:
notes, dashboard, briefing, assistant-history, alerts, ideas,
planner, fitness, milestones, changelog
- Wire service-registry to reinitialize services on session change
- Update auth handlers to trigger session changes on login/logout/restore
- Add useSessionEvents hook to clear React Query cache on session change
- Update ARCHITECTURE.md with user-scoped storage documentation
Global data (settings, hub-config, oauth-tokens) remains at root.
User data lives in {appData}/adc/users/{userId}/.
Closes user data isolation issue where different Hub accounts
would see each other's local data.
8df71a9 to
a908ed8
Compare
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.
Summary
Implements user-scoped data storage to isolate user data by Hub account, enabling multi-user support on shared machines.
Key Changes
UserSessionManagerservice tracks current logged-in user and notifies services when user changesUserDataResolverdetermines the correct data directory based on authentication statereinitialize(newDataDir)pattern to reload data when user changesUserDataMigratorhandles migration of existing global data to user-scoped directoriesServices Updated
All 12 data-storing services now support user-scoped storage:
Data Flow
Verification
Plan Reference
See
docs/features/user-scoped-storage/plan.mdfor full implementation plan.