Skip to content

A configuration with a JSON error at launch isn't reloaded when you fix it #206

Closed

Description

@Seb-GRAF

What happens

If config.json has a JSON syntax error when StableBar starts, StableBar shows the error but never watches the file. Fixing and saving the file changes nothing until Reload, StableBar --reload or a restart.

The same failure also skips choosing the bar for the current screen setup and starting package update checks.

Steps to reproduce

  1. Quit StableBar.
  2. Break the JSON in ~/.config/stablebar/config.json, for example by removing a closing brace.
  3. Start StableBar. It reports the error.
  4. Fix the file and save it.

Expected

StableBar applies the file when you save it, as the README says ("StableBar applies the file when you save it, and keeps the last working bar if a change is invalid").

Environment

Found by reading the code on current main. No reporter environment.

Evidence

Read on main at 4160f7f. Not reproduced in a running app.

Diagnosis

  • Sources/StableBar/BarStore.swift:104-128: one do block runs migrateConfigurationFile (line 115), migrateEarlierColors, the screen setup choice, reloadConfiguration() and packageLibrary.startUpdateChecks() (line 125). The catch only sets configurationError (line 127).
  • Sources/StableBar/ConfigurationEdits.swift:236-238: migrateConfigurationFile decodes the main file with JSONDecoder before anything else, so a syntax error throws there. migrateEarlierColors (line 265) does the same.
  • Sources/StableBar/BarStore.swift:193: the file watcher is armed only in readConfiguration's defer, which never runs when the migration throws first.

An error found later, inside readConfiguration, is fine: the defer still arms the watcher.

Related

Triaged by Claude Code via T3 Code (Claude Opus 5.5).

Activity

  1. added
    bug
    on Oct 22, 2026
  2. stablebar-releases commented on Oct 23, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.6.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions