diff --git a/packages/moxxmpp/CHANGELOG.md b/packages/moxxmpp/CHANGELOG.md index a8c57f6..ee3c3d7 100644 --- a/packages/moxxmpp/CHANGELOG.md +++ b/packages/moxxmpp/CHANGELOG.md @@ -23,6 +23,9 @@ - *BREAKING*: `UserAvatarManager`'s `getAvatarId` with `getLatestMetadata`. - The `PubSubManager` now supports PubSub's `max_items` in `getItems`. - *BREAKING*: `vCardManager`'s `VCardAvatarUpdatedEvent` no longer automatically requests the newest VCard avatar. +- *BREAKING*: `XmppConnection` now tries to ensure that incoming data is processed in-order. The only exception are awaited stanzas as they are allowed to bypass the queue. +- *BREAKING*: If a stanza handler causes an exception, the handler is simply skipped while processing. +- Add better logging around what stanza handler is running and if they end processing early. ## 0.3.1 diff --git a/packages/moxxmpp/lib/src/connection.dart b/packages/moxxmpp/lib/src/connection.dart index 1cffafe..bc8466d 100644 --- a/packages/moxxmpp/lib/src/connection.dart +++ b/packages/moxxmpp/lib/src/connection.dart @@ -685,7 +685,13 @@ class XmppConnection { _log.finest( 'Running handler for ${stanza.tag} (${stanza.attributes["id"]}) of $managerName', ); - state = await handler.callback(state.stanza, state); + try { + state = await handler.callback(state.stanza, state); + } catch (ex) { + _log.severe( + 'Handler from $managerName for ${stanza.tag} (${stanza.attributes["id"]}) failed with "$ex"', + ); + } if (state.done || state.cancel) { _log.finest( 'Processing ended early for ${stanza.tag} (${stanza.attributes["id"]}) by $managerName',