Skip to content

fix(ingest): resolve advert endpoints after node updates - #166

Merged
MrAlders0n merged 2 commits into
MeshCore-Beacon:devfrom
n30nex:codex/beacon-packet-endpoints
Sep 30, 2026
Merged

MrAlders0n merged 2 commits into
MeshCore-Beacon:devfrom
n30nex:codex/beacon-packet-endpoints

Conversation

@n30nex

@n30nex n30nex commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

First or renamed adverts could broadcast missing or old source names because live resolution ran before the node update. Apply payload side effects before resolving inserted observations; optional new-path repeats resolve current identity without reapplying the old advert. Suppressed copies do no live-only endpoint work.

Closes #164. Independent on accepted dev.

Parent db30c9b573357990c41166292e7cf42785c92cc4, head 319df7da5246a71f9693f923d2124bf831eabb82. Focused diff.

Published-head CI and the complete combined native Pi/PostgreSQL suite pass. The Pi runs server a35cba1d / web e1133ab5, retaining every review candidate. Windows/Pi web build/lint and all 940 tests pass. The isolated 3,200-input/504-scope replay preserved expected data/events with zero fixture drops; this is not a universal production losslessness claim. Validation, exact heads and recovery / running source.

Maintainers retain merge/release control; AI-assisted work continues under the contributor's standing authorization.

@n30nex
n30nex requested a review from 446564 as a code owner September 26, 2026 07:37
@n30nex

n30nex commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

@MrAlders0n, please review this focused fix (and have Claude review it if useful). It is independent of the analytics-retention work and can merge separately. Native Pi/PostgreSQL validation passed for 74f16de. The formal review-request API is not available to this contributor account, so I am requesting review here.

@n30nex

n30nex commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

@MrAlders0n, ready for your / Claude's review at 2c5ad5fc. The declared server stack has been refreshed for accepted #170; this PR body now links its current focused diff and dependency. Full native Pi/PostgreSQL tests pass in composed server 99e623c5, with every existing candidate included. Exact-head CI passes.

The preview/source now runs server 99e623c5 / web 3b3abdcc. Migration 041 was tested on a restored copy with unchanged row fingerprints; prior database/binary/web recovery is retained. Server merge order is #167 -> #169 -> #172; #166 remains independent. No upstream merge or production switch was performed.

@n30nex
n30nex force-pushed the codex/beacon-packet-endpoints branch from 2c5ad5f to e1c4fa2 Compare September 28, 2026 21:55
@n30nex

n30nex commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

@MrAlders0n / Claude: #166 is refreshed onto db30c9b5 at e1c4fa2f70ae6b5efc0054b91433460d07f06ce1 and ready for another look. This was the one source conflict in the coordinated refresh.

The fix now keeps your optional new-path repeat events: inserted observations apply their payload side effects before live endpoint resolution; repeat events resolve the current name without applying an older advert again. Suppressed copies do neither live endpoint lookup nor repeated side effects. First/renamed-advert regressions failed on the upstream ordering and pass here; the added repeat regression checks the latest name and lookup/upsert counts.

Focused diff. Actual-head CI passes. The Pi composition also passes full PostgreSQL tests and a 504-scope replay of 3,200 inputs during blocked route maintenance, with all expected rows/events and zero fixture drops. All pending features are still in the preview; no upstream merges were performed.

@MrAlders0n MrAlders0n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is right, and the bug is still on dev. The lookup on dev still runs before handlePayloadTypeSideEffects. This needs a rebase onto dev (conflict in internal/ingest/packet.go with #178 and #179):

  • Keep #178's repeat logic: if inserted || repeat { if inserted { side effects + MarkSent } ; lookup ; event }.
  • Drop the "Duplicates emit no packet event" comment. It's no longer true with includeRepeats.
  • Drop the InsertObservation override in endpoint_matching_test.go. #179 already sets observationInserted.
  • Optional: UpsertNode already returns the node id, so the advert path could skip GetNodeByPubkey.
  • An advert repeat test (includeRepeats on, duplicate on a new path) would be a nice addition.

@n30nex

n30nex commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@MrAlders0n / Claude: addressed at 319df7da.

The #178/#179 integration is retained: inserted observations run side effects/MarkSent before lookup and event; repeats do not reapply old adverts. The outdated duplicate-event comment was already removed, and the redundant InsertObservation override is now gone. The advert-repeat regression passes. I left the optional UpsertNode-ID shortcut separate to avoid changing side-effect return plumbing during this correction.

Published-head CI and the complete combined native Pi/PostgreSQL suite pass. The Pi runs server a35cba1d / web e1133ab5, retaining every review candidate. Windows/Pi web build/lint and all 940 tests pass. The isolated 3,200-input/504-scope replay preserved expected data/events with zero fixture drops; this is not a universal production losslessness claim. Validation, exact heads and recovery / running source.

Please take another look when convenient; no upstream merges were performed.

@MrAlders0n
MrAlders0n requested review from MrAlders0n and removed request for 446564 September 30, 2026 11:21
@MrAlders0n
MrAlders0n merged commit 97cc22a into MeshCore-Beacon:dev Sep 30, 2026
3 checks passed
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.

Live advert endpoints can retain the previous node name

2 participants