Bug 466440 - Duplicate copies of the same account in the "Switch User" menu
Summary: Duplicate copies of the same account in the "Switch User" menu
Status: RESOLVED FIXED
Alias: None
Product: Tokodon
Classification: Applications
Component: general (show other bugs)
Version: 23.02.0
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-26 00:50 UTC by Spry
Modified: 2023-05-14 11:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
I logged in with three accounts. Tokodon showed six items. (59.66 KB, image/png)
2023-04-08 10:10 UTC, Vee Satayamas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Spry 2023-02-26 00:50:00 UTC
SUMMARY
A very strange display issue. After authorizing a Mastodon account, all seems well. However, if I close and re-open the app, and click "Switch User", there are now two versions of that account, and I'm able to switch back and forth between them.

If I delete one of them, things seem okay until the next time I close and re-open the app. At that point ALL of my accounts are logged out, not just the one I clicked "Log Out" for.

STEPS TO REPRODUCE
1. Authorize an account.
2. Close Tokodon.
3. Re-open Tokodon.
4. Check the Switch User menu.

OBSERVED RESULT
One or more accounts are duplicated in the Switch User menu.

EXPECTED RESULT
Each authorized account appears once.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04
Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
This affects all accounts, not just the first one added.
Comment 1 Joshua Goins 2023-02-26 03:10:54 UTC
I can confirm this happens, and I'm building in stronger safeguards in the next release to prevent this from happening. Can you confirm that the accounts show up normally after logging back in?
Comment 2 Spry 2023-02-26 05:46:25 UTC
(In reply to Joshua Goins from comment #1)
> I can confirm this happens, and I'm building in stronger safeguards in the
> next release to prevent this from happening. Can you confirm that the
> accounts show up normally after logging back in?

Yes, they are normal again after logging back in.
Comment 3 Vee Satayamas 2023-04-08 10:10:40 UTC
Created attachment 157952 [details]
I logged in with three accounts. Tokodon showed six items.
Comment 4 Bug Janitor Service 2023-05-14 01:49:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/tokodon/-/merge_requests/229
Comment 5 Carl Schwan 2023-05-14 11:26:35 UTC
Git commit 0c7176debb260079fc1123a3bd899a1ca17c16c7 by Carl Schwan, on behalf of Joshua Goins.
Committed on 14/05/2023 at 11:26.
Pushed by carlschwan into branch 'release/23.04'.

Squash yet another duplicate accounts bug

Sometimes when we write to settings, it can happen before we even set
the username and other important information. Now let's try to stop
writing malformed settings because they are going to be useless anyway.
This prevents another instance where many duplicate accounts can form.


(cherry picked from commit 19885f303bbb6c8c5f3edc35c27e502775f6132c)

M  +6    -0    src/account.cpp

https://invent.kde.org/network/tokodon/commit/0c7176debb260079fc1123a3bd899a1ca17c16c7