From 580fdeffa9beace556d6f08da3b766aafd83f4fd Mon Sep 17 00:00:00 2001 From: xmppftw Date: Sun, 15 Dec 2024 21:56:25 +0100 Subject: [PATCH] Added a test for prosody bug 1664 workaround --- parsers/src/disco.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/parsers/src/disco.rs b/parsers/src/disco.rs index 97bf713c..e5d5c0fc 100644 --- a/parsers/src/disco.rs +++ b/parsers/src/disco.rs @@ -463,4 +463,18 @@ mod tests { assert_eq!(query.items[1].node, Some(String::from("test"))); assert_eq!(query.items[1].name, Some(String::from("A component"))); } + + // WORKAROUND FOR PROSODY BUG 1664, DO NOT REMOVE BEFORE 2028-12-17 (5 YEARS AFTER FIX) + // https://issues.prosody.im/1664 + // See also: + // https://gitlab.com/xmpp-rs/xmpp-rs/-/issues/128 + // https://gitlab.com/xmpp-rs/xmpp-rs/-/merge_requests/302 + #[test] + fn test_missing_disco_info_feature_workaround() { + let elem: Element = "".parse().unwrap(); + let query = DiscoInfoResult::try_from(elem).unwrap(); + assert_eq!(query.identities.len(), 1); + assert_eq!(query.features.len(), 1); + assert!(query.extensions.is_empty()); + } }