Skip to content

Handle failed file writes gracefully in settingsStore save methods #311

Description

@Kirtan-pc

Description

In settingsStore.js, the save() and saveProfiles() functions write configuration data to the filesystem using synchronous calls (fs.writeFileSync). If the disk is full, file permissions are read-only, or the file is locked, these operations throw unhandled exceptions, causing the Electron process to crash or stall without presenting a helpful error to the user.

Steps to Reproduce

  1. Locate the Paraline user data directory containing the settings files (settings.json, themeProfiles.json).
  2. Restrict file permissions for these files or their parent folder to read-only.
  3. Open the Settings window in Paraline and attempt to toggle a setting or save a new theme profile.
  4. Observe that the settings UI freezes or throws uncaught exceptions in the console.

Expected Behaviour

The save methods in the settings store should catch filesystem write errors gracefully, log them, and return a failure status so that the frontend can inform the user that changes could not be written to disk.

Actual Behaviour

Unhandled exceptions are thrown on write failures, leading to unstable application states.

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