HydraIssues

hydradistrict: no district has coordinates, so /api/v1/nearest is dead in production
open bug Project: experiencenet Reporter: 31 Aug 2026 18:52

Description

Every district on the live hydradistrict is missing latitude and longitude, so the geo-proximity feature added in commit 80436f9 does not work at all.

Reproduce

curl -s https://hydradistrict.experiencenet.com/api/v1/nearest?lat=51.21&lon=3.22
{"error":"no districts with coordinates found","code":404}

curl -s https://hydradistrict.experiencenet.com/api/v1/districts/bxl1 | jq '{latitude,longitude}'
{"latitude":null,"longitude":null}

All 6 districts are affected: eu-nbg1, bxl1, bxl1-test, bxl1-test-2, bxl1-test-3, local-dev.

Cause

The Latitude and Longitude fields were added to store.District after the districts were created (eu-nbg1 and bxl1 date from 2026-02-18). Existing records were never backfilled, and handleNearest skips any district where both are zero, so it always finds nothing.

This is a data gap, not a code bug. handleNearest and the haversine are correct.

Impact

Found while building hydratam (#620), which reads hydradistrict to measure how far each target city sits from the nearest place we can run an experience from. That is the coverage argument for the whole go-to-market map, and it returns nothing today. hydratam now reports the cause explicitly rather than showing silent nulls:

"warning": "none of the 6 districts in hydradistrict carry coordinates, so no distance can be measured; set latitude and longitude on them with PUT /api/v1/districts/{id}"

Fix

Backfill the two real districts. PUT is a full replace, so send the existing name, location, provider and services along with the coordinates, or they will be cleared.

  • bxl1: 50.85, 4.35 (Brussels). Carries hydrarelease and hydratransfer service URLs that must be preserved.
  • eu-nbg1: 49.45, 11.08 (Nuremberg).

The three bxl1-test districts and local-dev can take the same coordinates as their parent or be left alone; they should not be selected for a real coverage answer anyway.

Not done here because it is a write to production infrastructure outside the scope of the hydratam work.

Worth considering

Require coordinates on create. A district without them cannot answer the one question the nearest endpoint exists for, so accepting it silently is what let this sit unnoticed since February.