Error during account creation breaks display of all other accounts on that server configured in client
Error during account creation breaks display of all other accounts on that server configured in client. Guessing something failed in account creation and Gajim didn't handle it as expected.
Versions
- OS: Linux
- GTK+ Version: 3.24.5
- PyGObject Version: 3.30.4
- python-nbxmpp Version: 0.6.10
- Gajim Version: 1.1.2
Starting condition: Gajim client with two connected accounts on the same server (a@my.server, b@my.server). Display label for a@my.server is just '@my.server' (the default value), display for the second account is the full jid ('b@my.server').
I make a new account ('c@my.server') on the server. Didn't change any default settings. There was some certificate error from the server, but clicked through it and made the account anyway. The account is successfully created on the server. The following error popped up:
Traceback
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gajim/roster_window.py", line 1117, in _really_draw_accounts
self._really_draw_account(acct)
File "/usr/lib/python3/dist-packages/gajim/roster_window.py", line 1056, in _really_draw_account
assert False, 'Account iter of %s could not be found.' % account
AssertionError: Account iter of my.server could not be found.
Then I tried to open c@my.server from the main list and got this error:
Traceback
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gajim/gtk/accounts.py", line 107, in on_child_visible
self.check_relogin()
File "/usr/lib/python3/dist-packages/gajim/gtk/accounts.py", line 141, in check_relogin
self.relog(account)
File "/usr/lib/python3/dist-packages/gajim/gtk/accounts.py", line 145, in relog
if app.connections[account].connected == 0:
KeyError: 'my.server3'
Because I can't open the account, I try to remove the account (using the remove from client only option):
Traceback
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gajim/config.py", line 641, in on_remove_button_clicked
remove()
File "/usr/lib/python3/dist-packages/gajim/config.py", line 631, in remove
self._on_remove_success(True)
File "/usr/lib/python3/dist-packages/gajim/config.py", line 666, in _on_remove_success
app.config.del_per('accounts', self.account)
File "/usr/lib/python3/dist-packages/gajim/common/config.py", line 618, in del_per
del opt[1][name]
KeyError: 'my.server3'
This is when I notice the bugged account label is '@my.server', the same as a@my.server. Possibly part of the issue? I renamed it to 'c@my.server' and deleting the account again didn't cause any errors.
Next I added the c@my.server back to the client (using the "already have an account" option). I don't change any default setttings. No errors, but now the main UI is only showing two accounts connected to that server, and they are not displaying normally. They look like 'my.server1' and 'my.server3', and the third account isn't showing in the client at all.
I try to add a contact to the new user (c@my.server):
Traceback
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gajim/roster_window.py", line 3676, in on_add_new_contact
AddNewContactWindow(account)
File "/usr/lib/python3/dist-packages/gajim/gtk/add_contact.py", line 81, in __init__
for j in app.contacts.get_jid_list(acct[0]):
File "/usr/lib/python3/dist-packages/gajim/common/contacts.py", line 376, in get_jid_list
return self._accounts[account].contacts.get_jid_list()
KeyError: 'my.server2'
Server logs show that all three accounts are still connected and pinging as expected.
I restart the client. Now I see four accounts for that server in the main UI:
- @my.server
- my.server2
- b@my.server
- c@my.server
Interestingly, when I was re-adding c@my.server, I didn't change the display label, Gajim automatically made it the full jid (even though it chose to make the display label '@my.server' when I created the account).
I think my.server2 is the one I tried to delete, the Label and Login fields in the settings are empty. Tried deleting it again. Looks successful. Restarted client again, my.server2 is still deleted.
However, on restart password entry dialogs all show "Please enter your password for account my.server" (or my.server1/my.server2) and I can't remember if that was the behavior before or if it showed name@my.server. Either way, it would be better UX for the account description in the password prompt to be more descriptive (so I don't have to guess which is account 0/1/2). This behavior persists across multiple client restarts.
Main list UI now shows account labels as expected.