Conversation
Copilot
AI
changed the title
[WIP] Audit Openfire's PubSub compliance against XEP-0060 version 1.30.0
Fix XEP-0060 PubSub compliance: purge-node ClassCastException and missing payload size enforcement
Mar 13, 2026
guusdk
reviewed
Mar 24, 2026
guusdk
reviewed
Mar 24, 2026
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/PubSubEngine.java
Show resolved
Hide resolved
guusdk
reviewed
Mar 24, 2026
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/PubSubEngine.java
Show resolved
Hide resolved
guusdk
approved these changes
Mar 24, 2026
Member
guusdk
left a comment
There was a problem hiding this comment.
These changes look good to me. Can we rewrite the commit message(s) (possibly split them into two distinct commits) to include the JIRA identifiers of the tickets that I created for each of the issues fixed just now?
4c0c46c to
f76c563
Compare
Member
|
rebased and split commits... |
f76c563 to
020ee69
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two XEP-0060 §1.30.0 compliance bugs in
PubSubEngine, both covered by new unit tests inPubSubEngineTest.Bug 1:
purgeNodethrowsClassCastExceptionon collection nodesThe
isCollectionNode()guard came after an unconditional(LeafNode) nodecast, so purging a collection node crashed instead of returning the spec-required error.Fix: Swap the order — check
isCollectionNode()first, then cast.Bug 2:
publishItemsToNodeignoresmaxPayloadSizeLeafNode.maxPayloadSizewas stored and exposed but never checked — a TODO comment acknowledged this gap. XEP-0060 §7.1.3.5 requires returning<not-acceptable/>+<payload-too-big/>when the payload exceeds the configured limit (default 10 MB).Fix: Added byte-length check (UTF-8) in the item-processing loop after existing payload structure validation:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.