Skip to content

Node detail "Heard By": the Regions line and Region column read a field the endpoint does not emit #2062

Description

@efiten

public/nodes.js builds two pieces of the "Heard By" card from o.iata:

  • nodes.js:781 — a Regions: line above the heading, [...new Set(observers.map(o => o.iata).filter(Boolean))]
  • nodes.js:790 — a Region column header, with data-sort-key="region"

/api/nodes/{pubkey}/health emits neither. The rows are HealthObserverRow (cmd/server/direct_heard.go:54-61) and carry exactly observer_id, observer_name, avgSnr, avgRssi, packetCount, can_relay. Confirmed against a running instance:

{"observer_id":"47F9548F…","observer_name":"BE-DUF-SiSCD-01",
 "avgSnr":6.65,"avgRssi":-110.88,"packetCount":8596,"can_relay":null}

So the Regions line never renders (filter(Boolean) empties the set) and the Region column prints an em dash on every row, including its sort control.

This is pre-existing and was named in #2057 ("It also documented an iata field on these rows that the endpoint has never emitted; removed" and "both have always been dead"), where it was correctly left out of scope. Filing it so it does not stay a remark in a merged description: the card was just rewritten, and it still ships a column that cannot hold a value and a sort key that cannot order anything.

Either direction is fine, they just need deciding

  1. Drop them. Remove the Regions line, the Region header and its data-sort-key. Smallest change, and the information is available on the observers page.
  2. Emit the field. Add ObserverIATA string \json:"observer_iata"`toHealthObserverRow and read that name in the template. The value is already joined in the query the builder walks (COALESCE(obs.iata, '')` appears in the observation queries), so this is plumbing rather than new data. Worth it only if per-observer region actually helps on this card — with direct lists now holding a handful of rows, grouping them by region may not.

Whichever is chosen, the fix should include an assertion in tests/unit/test-direct-rf-heard-by.js, which slices this exact template out of nodes.js and so can pin it.

Not investigated: whether other cards read o.iata off endpoints that do emit it under a different name. enrichObsWithTx uses observer_iata, so the mismatch may be a naming drift rather than a one-off.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions