From 29c93c1dd37676513b74b752c3a1d2a0e54f77eb Mon Sep 17 00:00:00 2001 From: Karti Tripathi Date: Wed, 5 Aug 2026 03:22:30 -0700 Subject: [PATCH] An empty live feed is not live data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A server whose marker source is unconfigured answers 200 with an empty array, and the client counted that as success. The deployed map came up with no pins at all, wearing a green "live data" badge — which is the one outcome worse than having no badge, because the badge exists precisely so a fabricated demo cannot be mistaken for real data, and here it was doing the reverse. Empty now falls back to the sample set and keeps saying "sample". Co-Authored-By: Claude Opus 5 --- src/adapters/http.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/adapters/http.ts b/src/adapters/http.ts index 962e497..44e5f22 100644 --- a/src/adapters/http.ts +++ b/src/adapters/http.ts @@ -167,6 +167,12 @@ export function createTeraClient(options: TeraApiOptions = {}): TeraClient { async markers(): Promise { const body = await get("/markers"); if (!body || !Array.isArray(body.markers)) return sampleMarkerFeed(); + // An API that answers with nothing is the default posture of a server + // whose marker source has not been configured, and it is indistinguishable + // to a viewer from a broken map. Fall back, and — more importantly — go on + // saying "sample", because the alternative is an empty map wearing a + // "live data" badge, which is the one outcome worse than no badge at all. + if (body.markers.length === 0) return sampleMarkerFeed(); return { // A `WireMarker` *is* a `Marker` with a provenance field on it, so this // is a widening and not a translation — which is the property