fix(observers): preserve advert pages with missing origin keys (#138)

* test(observers): cover adverts with a missing origin key

* fix(observers): preserve advert pages with missing origin keys
This commit is contained in:
n30nex authored and GitHub committed 2026-09-18 06:17:33 -04:00
1 parent e15f873597
commit b44769bef8
4 files changed
+90 -2

No files matched your search

+2 -1
View File
@@ -2860,7 +2860,7 @@ SELECT
po.snr,
po.hop_count,
n.name AS node_name,
encode(p.origin_pubkey, 'hex') AS node_public_key
COALESCE(encode(p.origin_pubkey, 'hex'), '')::text AS node_public_key
FROM packet_observations po
JOIN packets p ON p.packet_hash = po.packet_hash
LEFT JOIN nodes n ON n.public_key = p.origin_pubkey
@@ -2892,6 +2892,7 @@ type ListObserverAdvertsRow struct {
// Returns advert packets (payload_type=4) heard by a specific observer.
// Pass cursor=0 to start from the beginning, or the last seen id for pagination.
// Keep missing-origin adverts; the generated key field expects a string, not NULL.
func (q *Queries) ListObserverAdverts(ctx context.Context, arg ListObserverAdvertsParams) ([]ListObserverAdvertsRow, error) {
rows, err := q.db.Query(ctx, listObserverAdverts, arg.ObserverID, arg.Column2, arg.Limit)
if err != nil {