feat: show disk space-specific message in storage error toast#39746
feat: show disk space-specific message in storage error toast#39746gauthierpetetin merged 21 commits intomainfrom
Conversation
When storage write operations fail with FILE_ERROR_NO_SPACE, display a targeted message asking users to free up disk space urgently instead of the generic storage error message. Co-authored-by: Cursor <cursoragent@cursor.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [98e49b7]
UI Startup Metrics (1390 ± 96 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
For disk space errors, only show a warning message without the action button since the primary action is to free up space, not backup SRP. Co-authored-by: Cursor <cursoragent@cursor.com>
Add the missing storageWriteErrorType property to ControllerStatePropertiesEnumerated to fix TypeScript errors. This property was added to AppStateControllerState but was not enumerated in the background state types, causing the FlattenedBackgroundStateProxy type to become 'never'. Co-authored-by: Cursor <cursoragent@cursor.com>
Builds ready [9f2b5f0]
UI Startup Metrics (1400 ± 109 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Update en_GB locale to match the en locale changes: - Rename storageErrorDescription to storageErrorDescriptionDefault - Add storageErrorDescriptionNoSpace for disk space errors Co-authored-by: Cursor <cursoragent@cursor.com>
Add the new storageWriteErrorType property to all E2E test snapshots and fixture files to match the updated controller state. Co-authored-by: Cursor <cursoragent@cursor.com>
✨ Files requiring CODEOWNER review ✨🕵️ @MetaMask/extension-privacy-reviewers (1 files, +1 -1)
🧪 @MetaMask/qa (1 files, +1 -1)
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Builds ready [8b57b87]
UI Startup Metrics (1367 ± 96 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Add mock for shared/lib/trace to fix test failure caused by importing StorageWriteErrorType from shared/constants/app-state which has a transitive dependency on the trace module. Co-authored-by: Cursor <cursoragent@cursor.com>
Builds ready [56d8b6a]
UI Startup Metrics (1380 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [a67b7ad]
UI Startup Metrics (1388 ± 90 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
This reverts commit 59a2e5f. The mock is no longer needed as the underlying issue has been resolved in main. Co-authored-by: Cursor <cursoragent@cursor.com>
| trace: jest.fn(), | ||
| endTrace: jest.fn(), | ||
| TraceName: {}, | ||
| })); |
There was a problem hiding this comment.
Here, we add mock for '../../../../shared/lib/trace' to fix test failure caused by importing StorageWriteErrorType from '../../../../shared/constants/app-state' in persistence-manager.ts which has a transitive dependency on the trace module.
There was a problem hiding this comment.
Strange that a constants file would have tracing 🤔 Oh well.
Builds ready [b116620]
UI Startup Metrics (1395 ± 97 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Simplify failure tracking in PersistenceManager by removing the redundant boolean flag. Now #errorTypeBeforeCallbackRegistered serves dual purpose: if not null, it indicates a failure occurred and contains the error type. Co-authored-by: Cursor <cursoragent@cursor.com>
Infer toast visibility from storageWriteErrorType !== null instead of maintaining a separate boolean flag. This simplifies the state by removing redundancy as suggested in code review. Co-authored-by: Cursor <cursoragent@cursor.com>
Use truthy check instead of !== null to properly handle both null and undefined as "no error" in mock states during tests. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Tested locally, looks good to me ! |
Description
This PR enhances the storage error toast to show a specific message when the user's device is out of disk space. Previously, all storage write errors showed a generic message. Now, when the error contains "FILE_ERROR_NO_SPACE", the toast displays a targeted message asking users to free up disk space urgently to avoid losing wallet data.
Changelog
CHANGELOG entry: Added disk space-specific error message to storage error toast when device is out of space
Related issues
Fixes: N/A
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Primarily UI/state plumbing and copy changes; behavior changes are limited to how storage write failures are categorized and displayed in the toast.
Overview
Improves the storage error toast by tracking a typed storage write failure instead of a boolean flag, enabling more specific UX.
PersistenceManagernow classifies write failures (e.g.,FILE_ERROR_NO_SPACE) and notifies the background/UI with aStorageWriteErrorType, which is stored inAppStateControllerand used byToastMasterto render a disk-space warning message and suppress the SRP action button for no-space errors. Localization keys and state snapshot/tests are updated accordingly.Written by Cursor Bugbot for commit 908b2ad. This will update automatically on new commits. Configure here.