Fix: Handle localStorage crash on certain operations#4703
Closed
rakesh0x wants to merge 4 commits intosugarlabs:masterfrom
rakesh0x:Storagefixes
Closed
Fix: Handle localStorage crash on certain operations#4703rakesh0x wants to merge 4 commits intosugarlabs:masterfrom rakesh0x:Storagefixes
rakesh0x wants to merge 4 commits intosugarlabs:masterfrom
rakesh0x:Storagefixes
Conversation
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
Contributor
Author
|
hey @llaske can you please reveiw this pr |
Contributor
|
@rakesh0x sorry I'm not a reviewer for this project. |
Contributor
Author
|
hey @walterbender will you please review this pr |
Member
|
(1) Can you please make the darkmode change in a separate PR? |
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
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.
Problem
The application crashes in environments where
localStorageis not available or fails (e.g., private mode, low disk space, or security-restricted environments). This leads to unhandled exceptions and breaks the user experience.Fix
now , its just checks whether the saved data wasn't saved at all(i.e., null or missing ). it avoids unnecessary crashes from minor byte difference and focus on actual failure cases
Files Modified
js/ProjectStorage.jsTesting
Tested in environments with restricted storage and confirmed that the application no longer crashes. Warnings are logged but functionality continues smoothly.