Skip to content

fix(ingest): honor explicit zero locations in adverts - #139

Open
n30nex wants to merge 1 commit into
MeshCore-Beacon:devfrom
n30nex:codex/beacon-advert-location-reset
Open

n30nex wants to merge 1 commit into
MeshCore-Beacon:devfrom
n30nex:codex/beacon-advert-location-reset

Conversation

@n30nex

@n30nex n30nex commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Closes #97. A signed advert that explicitly includes latitude and longitude of 0/0 currently leaves the node's previous location in place.

Use the advert's location-presence flag when preparing the node update. Explicit zero coordinates now reach the database and the node-update event; adverts without a location field continue to preserve the previous coordinates. Signature validation is unchanged. This fixes subsequent eligible adverts; it does not backfill earlier resets.

Type of change

  • Bug fix
  • Tests

Checklist

  • go build ./... passes
  • gofmt -l . is empty
  • go vet ./... passes
  • go test ./... passes
  • I have read CONTRIBUTING.md

No schema, query, dependency, handler or API type change.

Testing notes

The signed-advert regression fails on the original condition for the explicit reset. It passes after the fix, along with ordinary coordinates, either coordinate zero, an omitted location and a tampered signature. The zero fixture sets the wire presence bit explicitly because the library's app-data encoder omits the field for 0/0.

Native Pi 5 formatting, build, vet and full Go tests pass. A real PostgreSQL transaction verifies that an omitted location preserves the old coordinates, explicit 0/0 replaces them on the same node, and a later omission preserves the reset. It ran without skipping against the private test database, using a temporary table and rollback.

The event uses the same coordinate pointers as the database update. The existing web update handler preserves numeric zero. These paths were reviewed; no synthetic advert was published into the live feeds.

AI tools assisted implementation and validation under the contributor's standing approval for this effort.

The Pi preview now serves combined revision cacdadfe with this fix and the still-open #138. Both broker feeds advanced after deployment; the observer-advert, activity and telemetry API checks passed. The PR itself remains independently based on dev at e15f873.

@n30nex

n30nex commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

@MrAlders0n please review this change with your Claude agent as part of the September 13 Beacon review batch. The current candidate is 2fe8ec246d3f; validation and Pi evidence are in the PR description.

Please check explicit 0/0 adverts versus omitted location fields, signature validation and database/event agreement. This PR is linked to issue #97 for closure on merge.

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.

Location update gets ignored

1 participant