Skip to content

fix(protocol): complete protocol conformance, delivery recovery and regression coverage - #2295

Merged
mbuckton merged 1035 commits into
developmentfrom
fix/MSG-374-udp-protocol-compliance
Oct 15, 2026
Merged

mbuckton merged 1035 commits into
developmentfrom
fix/MSG-374-udp-protocol-compliance

Conversation

@mbuckton

Copy link
Copy Markdown
Contributor

Summary

  • Complete protocol-compliance and conformance fixes across MQTT, MQTT 5, MQTT-SN 1.2/2.0, NATS/JetStream, CoAP, STOMP and related transport paths.
  • Improve durable packet-ID mapping, reconnect/recovery behaviour, delivery retirement and destination event-reaper scheduling.
  • Add MSG-413 scheduler-interleaving regression coverage and associated delivery/cleanup tests.
  • Add CODING_STANDARDS.md and perform behaviour-preserving Java style cleanup, retaining records and explicit local types.

Validation

  • Jenkins mapsmessaging-server-junit #239: SUCCESS; 8,772 tests, 0 failures, 38 skipped.
  • SonarCloud quality gate: OK; new-code coverage 80.6%, reliability/security/maintainability A, duplication 1.5%.
  • SonarCloud's analysis is currently attributed to development because the Jenkinsfile hardcodes -Dsonar.branch.name=development, despite the Jenkins job compiling this feature branch. This is an attribution issue, not evidence that these changes are already merged.

Integration notes

  • development has four commits not present on this branch; reconcile the Maven pom.xml changes and validate merge compatibility before completion.
  • Some non-blocking SonarCloud issues remain open; avoid behavioural refactoring solely to resolve cosmetic findings.

Refs: MSG-385, MSG-374, MSG-324, MSG-413

… invalid subscriptions

Preserve untrimmed STOMP subscription identifiers and destinations, report unknown transaction SEND errors, and reject duplicate subscription identifiers without replacing active subscriptions.

Refs: MSG-371
Add raw STOMP wire checks for pseudo-version rejection, missing transaction failures and duplicate subscription IDs, plus unit coverage of case-sensitive headers and preserved whitespace.

Refs: MSG-371
Use Java newline and NUL escapes rather than literal slash characters in added frame fixtures.

Refs: MSG-371
Verify duplicate SUBSCRIBE rejection precedes session registration and preserves the original alias mapping.

Refs: MSG-371
Normalize surrounding whitespace on inbound STOMP header keys and values while preserving case sensitivity, first-value semantics, quoted values and embedded colons. Move the strict whitespace-preservation assertion out of conformance tests into explicit MAPS compatibility coverage; keep comma-separated version token matching exact after trimming token spaces.

Refs: MSG-371
Preserve the current header-trimming compatibility rule, test padding and tabs before CRLF, and reject malformed accept-version entries without rejecting unsupported numeric versions alongside supported tokens.

Refs: MSG-371
Preserve direct namespace removal as first choice, resolve a registered alias to its existing namespace only on failure, reject ambiguous aliases, and clean the actual registered context key. Re-enable MSG-402 STOMP wire conformance and add focused controller regressions.

Refs: MSG-402
Validate canonical four-byte MQTT remaining lengths and strict UTF-8 for MQTT 3/5, reject zero/duplicate MQTT 5 Receive Maximum, refuse unsupported enhanced authentication methods before session creation, and reject client-to-server PUBLISH Subscription Identifiers while preserving server-to-client use.

Refs: MSG-387, MSG-390, MSG-391, MSG-393, MSG-395, MSG-396
Re-enable protocol conformance for malformed Variable Byte Integers, UTF-8, MQTT 5 Receive Maximum, client PUBLISH subscription identifiers and unsupported auth. Add focused JUnit decoder boundary, valid property and listener rejection tests.

Refs: MSG-387, MSG-390, MSG-391, MSG-393, MSG-395, MSG-396
…ssor

Complete MQTT 5 Receive Maximum parser imports and assert the actual DISCONNECT reason accessor in the listener regression test.

Refs: MSG-391, MSG-393
Prevent post-CLOSE application parsing, reject LF-only/malformed upgrade request lines, and stop outbound application writes/queued frames once closing begins while permitting an in-progress frame to finish.

Refs: MSG-370
Re-enable LF-only upgrade and post-CLOSE delivery requirements; test mixed line endings, lone CR, every split CRLF boundary, data in same/later reads after CLOSE, outbound refusal after close/error, and writer rejection of queued app frames after CLOSE.

Refs: MSG-370
Re-enable previously quarantined transport, SASL, anonymous JMS producer, expiration and delivery-delay checks. Keep existing normative assertions and test methods intact so remaining defects stay visible.

Refs: MSG-394, MSG-397, MSG-398, MSG-399, MSG-400, MSG-401
Validate incoming protocol headers, frame SIZE/DOFF/type, pre-OPEN maximum and first OPEN performative before dispatching to Proton; permit chunked headers and SASL-to-AMQP transition.

Refs: MSG-394, MSG-397
…e teardown

Validate inbound AMQP framing before Proton, return a supported protocol header for unsupported versions then disconnect, close on Proton transport errors, and defer remote CLOSE connection teardown until transport output has been flushed.

Refs: MSG-394, MSG-397
Add focused incremental parser tests for valid OPEN/BEGIN/heartbeat, every split-read boundary, wrong protocol versions, malformed SIZE/DOFF/TYPE, oversized pre-OPEN frames, illegal initial state, and SASL-to-AMQP transition.

Refs: MSG-394, MSG-397
Decode incoming transfers once and resolve the Properties.to address for anonymous sender links, retaining fixed-target link precedence. Preserve the original AMQP absolute-expiry-time through MAPS message translation for exact JMSExpiration on forwarding.

Refs: MSG-398, MSG-400
Offer DELAYED_DELIVERY capability on OPEN and translate x-opt-delivery-time into existing MAPS delayed-message scheduling; preserve outbound scheduled delivery annotation.

Refs: MSG-399
When AMQP absolute-expiry-time is absent, reconstruct original JMS expiration from the sender's creation-time + TTL rather than forwarding an elapsed relative TTL. Preserve it in outbound absolute-expiry-time to eliminate drift.

Refs: MSG-400
…t JMS expiration

Verify fixed-target precedence vs message Properties.to, missing destination behavior, x-opt-delivery-time mapping, absolute-expiry-time preservation and original creation-time plus TTL handling.

Refs: MSG-398, MSG-399, MSG-400
… once

Do not consume empty client response rounds; send SASL-OUTCOME only on actual mechanism completion, keeping subsequent polling pure. Expose a package-private constructor for transport-state regression tests.

Refs: MSG-401
Cover no client response yet, failed read and successful challenge/outcome handoff with a mock Proton SASL transport, preserving configured mechanism identity.

Refs: MSG-401
…nversion

Reject UINT32 frame lengths exceeding addressable packet size instead of overflowing the signed Java counter.

Refs: MSG-397
Re-enable the seven disabled MSG-388 and MSG-389 wire-level tests; add focused red/green packet-level regression tests for filter syntax, zero packet ID, reserved options, shared no-local, subscription identifiers, and MQTT 5 per-filter UNSUBACK reason codes. Preserve exact expected wire bytes and valid-case controls.

Refs: MSG-386, MSG-388, MSG-389
Resolve MSG-386, MSG-388 and MSG-389 at the packet boundary. Encode one ordered MQTT 5 UNSUBACK reason per filter, validate shared/wildcard filters and SUBSCRIBE options, preserve UTF-8 byte lengths, and return CONNACK 0x01 before closing on unsupported MQTT protocol levels.

Refs: MSG-386, MSG-388, MSG-389
Test supported/unsupported protocol name-level combinations and close callback after CONNACK 0x01. Update legacy UNSUBACK consumption test for MQTT 5 mandatory reason codes, retain truncation checks, and correct large response length assertion.

Refs: MSG-386, MSG-389
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1842436d-7bc3-4d58-a2a0-a66272ee7cb9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mbuckton
mbuckton merged commit 7a309c3 into development Oct 15, 2026
2 of 4 checks passed
@mbuckton
mbuckton deleted the fix/MSG-374-udp-protocol-compliance branch October 15, 2026 04:02
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.

1 participant