Skip to content

fix: handle corrupted localStorage data in useMixedTasks#1377

Open
Shan7Usmani wants to merge 1 commit into
aryandas2911:mainfrom
Shan7Usmani:fix-localstorage-json-parse
Open

fix: handle corrupted localStorage data in useMixedTasks#1377
Shan7Usmani wants to merge 1 commit into
aryandas2911:mainfrom
Shan7Usmani:fix-localstorage-json-parse

Conversation

@Shan7Usmani
Copy link
Copy Markdown

Fixes #1289

Description

This PR fixes a crash caused by corrupted activeRoutineTasks data in localStorage.

Problem

The hook directly used JSON.parse() when initializing and syncing routine tasks. If the stored value contained malformed JSON, an exception would be thrown, causing the application to crash.

Changes Made

  • Added error handling around JSON.parse() calls.
  • Gracefully handle malformed localStorage data.
  • Remove corrupted activeRoutineTasks entries from localStorage.
  • Fallback to an empty array when parsing fails.
  • Added console logging to aid debugging.

Impact

This prevents application crashes caused by invalid localStorage data and improves the overall stability and user experience.

@Karanjot786
Copy link
Copy Markdown

Hey @Shan7Usmani! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 67 unassigned GSSoC issues open. 19 are marked good first issue. Your JavaScript background transfers directly.

Karanjot, TermUI maintainer

@Shan7Usmani
Copy link
Copy Markdown
Author

Hey @Shan7Usmani! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 67 unassigned GSSoC issues open. 19 are marked good first issue. Your JavaScript background transfers directly.

Karanjot, TermUI maintainer

Hi @Karanjot786,

Thank you for reaching out and for the invitation.

I'm currently contributing to GSSoC 2026 and would be interested in exploring TermUI as well. I'll take a look at the open issues and see where I can contribute.

I appreciate and accept your invitation to this opportunity!

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.

[Bug] Missing JSON.parse Error Boundary permanently bricks the UI on corrupted localStorage

2 participants