From ffa3160348543097cfd6509f66169e618f0183e2 Mon Sep 17 00:00:00 2001 From: hermes-gadget Date: Thu, 17 Sep 2026 14:16:44 +0000 Subject: [PATCH] fix(api): expose region_scope in /packets/recent raw events (eng-ne feed toggle) The raw=1 response path (getRecentPacketEvents) omitted region_scope, so consumers filtering on region scope (nemesh.uk compat region=eng-ne) could never match, even though packets were correctly tagged at ingest. Add the column to the SELECT. Verified live: 1000-row raw fetch now carries region_scope and the compat filter serves #eng-ne rows from real data. --- backend/src/db/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/db/index.ts b/backend/src/db/index.ts index cc0339d..3feda8b 100644 --- a/backend/src/db/index.ts +++ b/backend/src/db/index.ts @@ -1118,7 +1118,8 @@ export async function getRecentPacketEvents(limit = 200, network?: string, obser p.topic, p.iata, p.packet_type, p.hop_count, p.rssi, p.snr, p.payload, p.payload->>'_summary' AS summary, - p.advert_count, p.path_hashes, p.path_hash_size_bytes + p.advert_count, p.path_hashes, p.path_hash_size_bytes, + p.region_scope FROM packets p LEFT JOIN node_identity_aliases rx_alias ON rx_alias.source_node_id = UPPER(BTRIM(p.rx_node_id))