Skip to content

Validate JSON structure of exported settings backup files #316

Description

@Kirtan-pc

Description

If a user imports a settings backup file that has syntactically invalid JSON structure, the JSON.parse call in main.js throws an unhandled exception. This returns a raw syntax error exception string to the settings page instead of a user-friendly error banner.

Steps to Reproduce

  1. Create a backup JSON file and introduce a syntax error (e.g., leave a trailing comma or omit a closing brace).
  2. Click "Import Settings Backup" and select the malformed file.
  3. Observe the error toast displaying raw Node.js parsing exception messages (e.g., Unexpected token } in JSON...).

Expected Behaviour

The import handler should catch JSON parsing errors specifically and return a friendly error message indicating that the backup file is corrupt or malformed.

Actual Behaviour

Raw JavaScript/Node.js stack traces and parser exceptions are bubbled directly to the UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions