Skip to content

Fix XEP-0124 BOSH compliance: overactivity exception, ack handling, sentElements cleanup#3228

Closed
Copilot wants to merge 3 commits intocopilot/review-xep-0124-implementationfrom
copilot/sub-pr-3192-again
Closed

Fix XEP-0124 BOSH compliance: overactivity exception, ack handling, sentElements cleanup#3228
Copilot wants to merge 3 commits intocopilot/review-xep-0124-implementationfrom
copilot/sub-pr-3192-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

Openfire's BOSH implementation had three spec deviations around overactivity enforcement, request acknowledgement parsing, and response ack redundancy.

Changes

OF-3219 — Overactivity allows pause/terminate (XEP-0124 §11)

XEP-0124 grants clients one extra simultaneous request when pausing or terminating. The check was unconditional, rejecting valid requests at the limit.

// Before
if (pendingConnections >= maxRequests) { overactivity = TOO_MANY_SIM_REQS; }

// After
final boolean isPauseOrTerminate = connection.isTerminate() || connection.getPause() != null;
final int maxSimultaneousRequests = isPauseOrTerminate ? maxRequests + 1 : maxRequests;
if (pendingConnections >= maxSimultaneousRequests) { overactivity = TOO_MANY_SIM_REQS; }

OF-3220 — Parse client ack attribute; prune sentElements (XEP-0124 §9.2)

Added HttpBindBody.getAck() to expose the client's acknowledged RID. When present, entries up to that RID are pruned from the sentElements retransmission buffer rather than relying solely on a maxRequests-sized cap. Unit tests added in HttpBindBodyTest.

OF-3221 — Suppress redundant ack in responses (XEP-0124 §9.1)

"the connection manager SHOULD NOT include an 'ack' attribute in any response if the value would be the 'rid' of the request being responded to"

asBodyText() and createEmptyBody() now accept the responding-to RID and omit ack when it would equal that RID — the common steady-state case. A deprecated no-arg overload of createEmptyBody(boolean) is retained for call sites without a request context.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI added 3 commits March 25, 2026 14:49
…4 §11)

Per XEP-0124 §11, clients MAY send one additional simultaneous request if it
is a pause or terminate request. Previously the check fired at
pendingConnections >= maxRequests unconditionally, rejecting valid pause/terminate
requests from clients already at the limit.
…124 §9.2)

Add HttpBindBody.getAck() to expose the client's acknowledged RID. When
present, acknowledged entries are pruned from the sentElements retransmission
buffer rather than relying solely on a size cap.

Unit tests added in HttpBindBodyTest covering getAck() (present/absent/
invalid/negative), getRid(), and isPoll() variants.
…9.1)

Per XEP-0124 §9.1, the connection manager SHOULD NOT include an 'ack'
attribute in any response if the value would be the 'rid' of the request
being responded to (the common steady-state case).

asBodyText() and createEmptyBody() now accept the responding-to RID and
suppress the 'ack' attribute when it would be identical. A deprecated
no-rid overload of createEmptyBody() is retained for callers without a
specific request context.
Copilot AI force-pushed the copilot/sub-pr-3192-again branch from 1b43e97 to dd2c57e Compare March 25, 2026 15:12
Copilot AI changed the title [WIP] Fix XEP-0124 BOSH compliance: overactivity exception, ack handling, sentElements cleanup Fix XEP-0124 BOSH compliance: overactivity exception, ack handling, sentElements cleanup Mar 25, 2026
Copilot AI requested a review from guusdk March 25, 2026 15:15
@guusdk guusdk marked this pull request as ready for review March 25, 2026 15:42
@guusdk
Copy link
Copy Markdown
Member

guusdk commented Mar 25, 2026

Copilot didn't exactly do what I wanted. I've manually created the desired PR in #3229 - that PR replaces this PR.

@guusdk guusdk closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants