Issue: XEP-0030 Violation - disco#items errors are silently ignored #91
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description:
The
/disco itemscommand silently ignores error responses from the server. When a disco#items request returns an error (e.g.,<item-not-found/>,<service-unavailable/>,<forbidden/>), the user receives no feedback.XEP-0030 Reference
Per XEP-0030 Section 7 (Error Conditions):
The specification defines error conditions for both disco#info and disco#items queries:
<item-not-found/><service-unavailable/>Current Behavior
Result: Nothing happens. No output, no error message.
Expected Behavior
Expected:
Service discovery failed for nonexistent.server: item-not-found(Similar to how
/disco infohandles errors correctly)Root Cause Analysis
In iq.c, the disco#items implementation differs from disco#info:
disco#info (correct):
disco#items (buggy):
The response routing in the IQ handler (line ~205):
Comparison Table
connection_create_stanza_id())"discoitemsreq")iq_id_handler_add()cons_show_error()Suggested Fix
Refactor
iq_disco_items_request()to follow the pattern ofiq_disco_info_request():id_handlerfor response processing_disco_items_response_id_handler()that checks fortype='error'cons_show_error()Test Case
A functional test has been added that documents this bug:
This test currently uses
assert_false(prof_output_regex("Service discovery failed"))to verify the bug exists. When fixed, it should be changed toassert_true().Related