Gajim crashes while connecting to server when MAM history is recieved
Gajim crashes while connecting to server when MAM history is recieved.
Gajim spawns multiple error popups with the following message:
Traceback (most recent call last): File "c:\python27\lib\site-packages\nbxmpp\dispatcher_nb.py", line 497, in dispatch File "src\common\connection_handlers.py", line 1796, in _messageCB File "src\common\nec.py", line 76, in push_incoming_event File "src\common\nec.py", line 98, in _generate_events_based_on_incoming_event File "src\common\connection_handlers_events.py", line 1143, in generate File "src\common\logger.py", line 1123, in save_if_not_exists UnboundLocalError: local variable 'type_' referenced before assignment
After all errors dialogs are quitted client is unusable.
Trying to send ad-hoc commands, or simply querying user info for a contact re-triggers the error dialogs.
Connecting with a user that hasn't enabled archiving works fine.
Steps to reproduce
Enable archiving for user. Connect with a client that has part or none of the history.
OS version: Windows 7 SP1 x64
GTK version: 2.24.10
PyGTK version: 2.24.0
Prosody: 0.10 8b4c8e957211
The problem is actually related to archive elements that don't contain a body element. https://prosody.im/pastebin/df680ac3-07b5-48fe-a941-bbf9150627d9
If I remove line 8 from the archive gajim works as expected.
Testing involved two instances of poezio (latest git version). The first messages where sent with chat_states = disabled
The problem does not only relate to 0.16.3 on windows, as originally claimed, but also happens with a recent nightly build (Gajim 0.16.3-4a5f5f99d5db) on debian jessie.
Storing these elements was recently enabled in prosody's mod_mam. https://hg.prosody.im/prosody-modules/rev/4c2146f5bf39145a3d202b7bbbebb4f719b667b3
This commit shows that only messages with a <body> are stored. So I don't see why chatstates are stored on your server. Anyway Gajim should not crash because of that.