Crash when searching in a chat
Please first check if another issue has been opened for your problem
Versions
- OS: Ubuntu 24.04.1 LTS 24.04 (noble)
- GTK Version: 3.24.41
- PyGObject Version: 3.48.2
- GLib Version : 2.80.0
- libsoup Version: 3.4.4
- python-nbxmpp Version: 4.5.4
- Gajim Version: 1.8.4
Steps to reproduce the problem
- Click on a chat
- Click on the magnifying glass icon
- Type a word into the search field and press Enter
Expected behavior
Receive search results and no crash
Actual behavior
A popup window appears showing the following stack trace:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gajim/gtk/search_view.py", line 179, in _on_search
self._add_results()
File "/usr/lib/python3/dist-packages/gajim/gtk/search_view.py", line 199, in _add_results
result_row = ResultRow(
^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gajim/gtk/search_view.py", line 389, in __init__
self._client = app.get_client(account)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gajim/common/app.py", line 148, in get_client
return connections[account]
~~~~~~~~~~~^^^^^^^^^
KeyError: 'chat.example.com12'
Additional information
If I run the following code in a plugin:
accounts = []
for account in app.settings.get_accounts():
account_id = app.storage.archive.get_account_id(account)
accounts.append((account_id, account))
then the result is as follows:
[(1, "chat.example.com"),
(1, "chat.example.com1"),
(1, "chat.example.com12")]
i.e. all of the account IDs are the same. If have three accounts defined, but only one is enabled. Where are the duplicate account IDs coming from? And the account names?