Settings saved in one window are put back by the Settings dialog of another window #216

Closed
opened 2026-11-11 14:28:09 +00:00 by james.maes · 2 comments
Owner

What

Two gclo windows can be open at once (there is no single-instance rule). Each reads settings.json when it starts and keeps its own copy.

Since #212's review, what a window remembers by itself (the workspace that was open, Quick Sync's connection) is written over the file as it is on disk at that moment, so a window that closes no longer puts its older copy back.

The Settings dialog still works on the window's own copy:

  • it shows the values that window read at start, not what another window saved since;
  • its Save writes that whole copy, so settings saved in another window in the meantime are put back to the older values (theme, default folder, the address of the default Gitea server).

For the Gitea default this can leave the token in Credential Manager with no address in the file. The token is then taken up again when its address is entered in Settings (#212), so it is recoverable, but the user has to know to do that.

Wanted

One of:

  • the Settings dialog reads the file fresh when it opens, and Save writes only the fields the user changed over the file as it is then; or
  • one gclo window per data folder (a second start brings the first to the front).

The second is the simpler rule and also settles the same question for accounts.json prompts and the activity log, but it is a behavior change that needs the owner's decision.

Notes

Found by the review of #215. Not a regression: Settings has always been saved this way.

## What Two gclo windows can be open at once (there is no single-instance rule). Each reads `settings.json` when it starts and keeps its own copy. Since #212's review, what a window remembers by itself (the workspace that was open, Quick Sync's connection) is written over the file as it is on disk at that moment, so a window that closes no longer puts its older copy back. The Settings dialog still works on the window's own copy: - it shows the values that window read at start, not what another window saved since; - its Save writes that whole copy, so settings saved in another window in the meantime are put back to the older values (theme, default folder, the address of the default Gitea server). For the Gitea default this can leave the token in Credential Manager with no address in the file. The token is then taken up again when its address is entered in Settings (#212), so it is recoverable, but the user has to know to do that. ## Wanted One of: - the Settings dialog reads the file fresh when it opens, and Save writes only the fields the user changed over the file as it is then; or - one gclo window per data folder (a second start brings the first to the front). The second is the simpler rule and also settles the same question for `accounts.json` prompts and the activity log, but it is a behavior change that needs the owner's decision. ## Notes Found by the review of #215. Not a regression: Settings has always been saved this way.
Author
Owner

One more case of the same subject, from the last review of #215: if the Settings dialog stores a Gitea default token and the write of settings.json then fails, the token is in use with no address on disk. The window that later closes does not write the address either (it writes only what the app remembers by itself). The token can be taken up again by entering its address in Settings. Whatever is decided here should cover it: the dialog could store the token only after the settings are written, or put the token back when the write fails.

One more case of the same subject, from the last review of #215: if the Settings dialog stores a Gitea default token and the write of settings.json then fails, the token is in use with no address on disk. The window that later closes does not write the address either (it writes only what the app remembers by itself). The token can be taken up again by entering its address in Settings. Whatever is decided here should cover it: the dialog could store the token only after the settings are written, or put the token back when the write fails.
Author
Owner

Owner's decision (2026-11-11): one gclo window per data folder. Starting gclo again brings the open window to the front. The dev build beside the stable one keeps working, because it has its own data folder. This also covers the case in the comment above.

Owner's decision (2026-11-11): one gclo window per data folder. Starting gclo again brings the open window to the front. The dev build beside the stable one keeps working, because it has its own data folder. This also covers the case in the comment above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/gclo#216