Skip to content

Add error handling for localStorage operations #291

@avinxshKD

Description

@avinxshKD

I was testing the app in private browsing mode and it crashes immediately when trying to save graphs. Turns out all the localStorage calls in src/graph-builder/local-storage-manager.js and src/component/fileBrowser.jsx have zero error handling.

Lines like:

window.localStorage.setItem(this.ALL_GRAPHS, window.btoa(JSON.stringify(Array.from(this.allgs))));

Just throw and kill the app when localStorage is disabled or quota exceeded. No try-catch, no fallback, nothing.

Would be good to wrap these in try-catch blocks and either:

  1. Show a toast notification that persistence is unavailable
  2. Fall back to in-memory storage for the session
  3. Both

Similar to how the Axios error handling works elsewhere in the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions