Implement tenant-scoped localStorage for per-user UI state #15

Open
opened 2026-02-25 16:05:15 +01:00 by libretech · 0 comments
Owner

Summary

Scope all localStorage usage to the current tenant/user so that UI preferences do not leak between accounts on shared devices.

Implementation Tasks

  • Prefix all localStorage keys with tenant/user identifier
  • Migrate existing localStorage usage to scoped keys
  • Clear tenant-scoped data on logout
  • Handle missing/corrupted stored data gracefully

Design

  • Key format: librenotes:{user_id}:{key}
  • Fallback to defaults when scoped key does not exist
  • Clear all keys matching tenant prefix on logout

Acceptance Criteria

  • Two users on the same browser have independent UI state
  • Logging out clears the user's stored preferences
  • Invalid stored data is handled without crashes
## Summary Scope all localStorage usage to the current tenant/user so that UI preferences do not leak between accounts on shared devices. ## Implementation Tasks - [ ] Prefix all localStorage keys with tenant/user identifier - [ ] Migrate existing localStorage usage to scoped keys - [ ] Clear tenant-scoped data on logout - [ ] Handle missing/corrupted stored data gracefully ## Design - Key format: librenotes:{user_id}:{key} - Fallback to defaults when scoped key does not exist - Clear all keys matching tenant prefix on logout ## Acceptance Criteria - [ ] Two users on the same browser have independent UI state - [ ] Logging out clears the user's stored preferences - [ ] Invalid stored data is handled without crashes
libretech added the
phase-2
label 2026-02-25 16:05:15 +01:00
libretech changed title from Tenant-aware localStorage state to Implement tenant-scoped localStorage for per-user UI state 2026-02-28 20:25:34 +01:00
libretech added the
task
label 2026-02-28 20:25:37 +01:00
libretech added the
frontend
label 2026-02-28 21:59:11 +01:00
Sign in to join this conversation.
No description provided.