Skip to content

fix: Fix not saving first created account#2107

Merged
jubalh merged 1 commit intomasterfrom
fix/2106
Mar 9, 2026
Merged

fix: Fix not saving first created account#2107
jubalh merged 1 commit intomasterfrom
fix/2106

Conversation

@jubalh
Copy link
Member

@jubalh jubalh commented Mar 9, 2026

Commit 81f92f1 introduced a selective update mechanism to _accounts_save() to prevent overwrites when running multiple instances by only modifying the specific account being saved.

There was one mistake: the logic for adding a new
account was tied to the final iteration of a loop over existing accounts.

When starting with an empty accounts file, the
loop never executes though.

We can call g_key_file_set_value() directly and don't need the loop because this function will only modify one entry or add it if it doesn't exist.

I didn't test this PR.

Commit 81f92f1 introduced a selective update mechanism to
_accounts_save() to prevent overwrites when running multiple instances
by only modifying the specific account being saved.

There was one mistake: the logic for adding a new
account was tied to the final iteration of a loop over
existing accounts.

When starting with an empty accounts file, the
loop never executes though.

We can call g_key_file_set_value() directly and don't need the loop
because this function will only modify one entry or add it if it doesn't
exist.
@jubalh jubalh added this to the next milestone Mar 9, 2026
@jubalh jubalh requested a review from sjaeckel March 9, 2026 09:02
@jubalh
Copy link
Member Author

jubalh commented Mar 9, 2026

@sjaeckel I believe like this it should work as well?

Copy link
Member

@sjaeckel sjaeckel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that works. I tested it and it's fine now.

Thanks for the fix and sorry for breaking it 😬

@jubalh jubalh self-assigned this Mar 9, 2026
@jubalh jubalh merged commit 2056345 into master Mar 9, 2026
7 checks passed
@jubalh jubalh deleted the fix/2106 branch March 9, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants