[Bug] With two Genie windows open, saving a new profile in one removes the profiles saved in the other

Open
#443 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 5 days

@syntaki is already working on this.

Since Dec 1, 2026.

  • #468 by @syntaki — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
desktop

Research direction

Start with ProfileStore.Save and the Profiles.Load call in the MainWindowViewModel constructor, then trace the SaveProfiles() callers in the Connect dialog and the layout commands. Reproduce the steps with two windows and check Config/profiles.json after each save. Done when a profile saved in one window survives a save from another window, and the deletion and rename paths still behave correctly.

Written by the indexing model from the issue text.

Description

area:core bug est:<1d P2

What happened

I run one Genie window per character, all from the same install, so they share one profile list (Config/profiles.json).

Each window reads that file once, when it starts, and writes its whole list back whenever it saves a profile. A window that was already open when another window added a profile does not have that profile in its list, so its next save removes it from the file. The saved password and the startup layout go with it. Nothing is printed; the profile is just missing the next time Genie starts.

The Connect dialog is not the only thing that saves the list. Setting a startup layout does too (#layout default <name> on a profile layout, or Set as Default in Manage Layouts), so a window that has been open for days can remove another character's profile without the Connect dialog being opened.

What you expected

A profile saved in one window to still be there after another window saves. The file is shared, so a save should put this window's change on top of what the file holds now, not replace the file with what this window read when it started.

Steps to reproduce

  1. Start Genie and leave it open. This is window A.
  2. Start Genie a second time. This is window B.
  3. In B, open File > Connect.... Enter the name Second window, set Mode to Lich proxy (local) so no account is needed, and press Save. Close the dialog.
  4. Config/profiles.json now holds Second window.
  5. In A, open File > Connect.... The Profile list does not have Second window. Enter the name First window, set Mode to Lich proxy (local), and press Save.
  6. Config/profiles.json now holds only First window. Second window is gone.

Environment

  • OS + version: Ubuntu 26.04
  • Genie 5 version: 5.0.0
  • Install type: AppImage
  • Connection mode: not connected (the steps need no connection)

Logs / session capture

The profile names in Config/profiles.json:

after step 3:  Second window
after step 5:  First window

Anything else

Cause, as far as I can read it:

  • MainWindowViewModel calls Profiles.Load(_profilesPath) once, in its constructor.
  • ProfileStore.Save serialises the list it has in memory and replaces the file with it. It does not read the file first.
  • SaveProfiles() runs from the Connect dialog (Save and Delete), from Manage Layouts (Set as Default, and deleting or renaming the layout that is the profile's default), from #layout default <name> on a profile layout, and from #layout delete when the deleted layout was the profile's default.

The same is true of main as of 0a9b441.

Workaround: close every other window before doing anything that saves a profile, or keep a copy of profiles.json.

I have a fix with tests (Save reads the file again and puts only this window's own changes on top of it) and can open a pull request if that is welcome.

Dominant language
C#
Stars
2
Forks
5
Avg merge
4d 3h
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenieClient/Genie5

All issues in GenieClient/Genie5

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.