Skip to content

fix(LOC_BUILDER_DD): accept zero and reject missing coordinates - #5027

Merged
TomOnTime merged 1 commit into
DNSControl:mainfrom
spicysharkco:fix/loc-builder-dd-coordinates
Oct 21, 2026
Merged

TomOnTime merged 1 commit into
DNSControl:mainfrom
spicysharkco:fix/loc-builder-dd-coordinates

Conversation

@spicysharkco

Copy link
Copy Markdown
Contributor

LOC_BUILDER_DD({label: "site", x: 51.5, alt: 0}) passes dnscontrol check and print-ir emits a LOC record at longitude zero, although y is required. Conversely, {label: "origin", x: 0, y: 0, alt: 0} stops with LOC_BUILDER_DD requires x and y elements; it should produce the zero-coordinate LOC record.

The guard treats coordinates as booleans, and uses &&, so it rejects two zero values while accepting either missing property.

The fix checks each property for undefined. TestLOCBuilderDDCoordinates covers the valid zero pair and each missing property.

go test -p 1 -count=1 -run '^TestLOCBuilderDDCoordinates$' ./pkg/js/
go test -p 1 -count=1 ./pkg/js/

On the base commit all three regression rows fail. On the final tree the focused test passed three of three runs, and the package passed.

@TomOnTime
TomOnTime merged commit 3322ff1 into DNSControl:main Oct 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants