Skip to content

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#4703
rakesh0x wants to merge 4 commits intosugarlabs:masterfrom
rakesh0x:Storagefixes

Conversation

@rakesh0x
Copy link
Contributor

@rakesh0x rakesh0x commented Jun 8, 2025

Problem

The application crashes in environments where localStorage is 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.js

Testing

Tested in environments with restricted storage and confirmed that the application no longer crashes. Warnings are logged but functionality continues smoothly.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2025

✅ All Jest tests passed! This PR is ready to merge.

@rakesh0x
Copy link
Contributor Author

rakesh0x commented Jun 9, 2025

hey @llaske can you please reveiw this pr

@llaske
Copy link
Contributor

llaske commented Jun 9, 2025

@rakesh0x sorry I'm not a reviewer for this project.

@rakesh0x
Copy link
Contributor Author

rakesh0x commented Jun 9, 2025

hey @walterbender will you please review this pr

@walterbender
Copy link
Member

(1) Can you please make the darkmode change in a separate PR?
(2) Can you remove any unrelated changes? For example, you added some spaces to blank lines, end of lines.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2025

✅ All Jest tests passed! This PR is ready to merge.

@rakesh0x rakesh0x closed this Jun 9, 2025
@rakesh0x rakesh0x deleted the Storagefixes branch June 9, 2025 15:30
walterbender pushed a commit that referenced this pull request Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants