Skip to content

fix: ToXML emits the <contact> endpoint attribute (INFR-207) - #142

Merged
pdfinn merged 1 commit into
mainfrom
fix/INFR-207-contact-endpoint
Jun 5, 2026
Merged

fix: ToXML emits the <contact> endpoint attribute (INFR-207)#142
pdfinn merged 1 commit into
mainfrom
fix/INFR-207-contact-endpoint

Conversation

@pdfinn

@pdfinn pdfinn commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Hand-written ToXML block dropped the endpoint attribute (only wrote callsign), even when Contact.Endpoint was set. TAK server keys callsign->connection off endpoint, so DMs to that callsign were dropped at the server (root cause of INFR-206). Fix: emit endpoint when non-empty. Adds TestContactEndpointRoundTrip (endpoint in XML + survives round-trip) and a missing //go:build !novalidator tag on event_schema_error_test.go so the package builds under -tags novalidator. Validated: go test -tags novalidator -run RoundTrip passes. Consumers: takconnector has an interim vendored patch (revendor after merge); takmcp doesn't set endpoint (cosmetic).

🤖 Generated with Claude Code

Event.ToXML() is a hand-written serializer; its <contact> block wrote only
callsign and silently dropped endpoint, even though Contact.Endpoint was set.
The TAK server keys its callsign->connection mapping off that endpoint, so a
self-SA presence serialized without it (e.g. WithContact(Callsign:"NERVA",
Endpoint:"*:-1:stcp") -> <contact callsign="NERVA"/>) never got a callsign
assignment — inbound direct messages to that callsign were dropped at the
server. This was the root cause of the "DMs to NERVA never arrive" bug
(INFR-206; broadcasts worked because they ignore the callsign mapping).

- ToXML: emit endpoint when non-empty, mirroring the callsign block.
- roundtrip_test: TestContactEndpointRoundTrip guards it (endpoint appears in
  the XML AND survives a parse round-trip).
- event_schema_error_test: add the missing `//go:build !novalidator` tag (it
  exercises the cgo-only validator init-error path; without the tag the package
  fails to compile under -tags novalidator). Pre-existing gap, fixed so the
  round-trip test is runnable without libxml2.

Spot-audit of the other hand-written detail blocks: <group> (name, role) and
<__chat> (id/message/sender/chatroom/groupOwner/senderCallsign/parent/
messageId/deleteChild/grps) are complete; other detail elements round-trip via
the extension passthrough. The contact endpoint was the only dropped field.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@pdfinn
pdfinn merged commit dd03474 into main Jun 5, 2026
7 checks passed
@pdfinn
pdfinn deleted the fix/INFR-207-contact-endpoint branch June 5, 2026 07:48
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