stanzastream: handle malformed stanzas more gracefully

This introduces the FallibleStreamElement type which, instead of
failing parsing altogether, captures certain types of parse errors and
allows the user (in this case, the stanzastream) to react to these
errors appropriately.

This allows us to drop invalid stanzas (e.g. with malformed values in
strictly-checked fields) instead of failing the entire stream.

Fixes #172.
This commit is contained in:
Jonas Schäfer 2026-06-06 13:55:27 +02:00
commit cc92d113fa
11 changed files with 401 additions and 31 deletions

View file

@ -26,6 +26,10 @@ Version NEXT:
- Drive the XMPP client stream in the background (!631)
- Add option to split XMPP client into read and write half (!631)
- Remove T: AsXml bound from XmlStream (!675)
- Invalid stanzas are now handled dropped (after increasing the SM
counters) instead of failing the stream. Previously, that might have
caused continuous reconnect loops esp. with stream management (#172,
!675).
Version 5.0.0:
2025-10-28 pep <pep@bouah.net>