-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(storage): unify storage access through Storage wrapper
Previously, storage access was scattered throughout the codebase with direct references to user_storage and session_storage. This led to inconsistent error handling and made it harder to reason about storage access patterns. This change introduces a unified Storage wrapper that: - Provides a single point of access for both user and session storage operations - Enforces consistent error handling by mapping storage errors to domain errors - Removes redundant storage references from AppState and other components - Makes testing simpler by reducing setup complexity The storage traits remain separate under the hood, maintaining proper separation of concerns, while the wrapper provides a more ergonomic interface for common operations. This significantly reduces boilerplate and makes the codebase more maintainable. Key improvements: - Simplified error handling with proper error mapping - Cleaner API responses with proper status codes and JSON payloads - More robust session handling with SameSite cookie attributes - Reduced code duplication in tests
- Loading branch information
1 parent
9fe766d
commit 01f3fc8
Showing
5 changed files
with
132 additions
and
94 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.