Backlog: add GitHub production-data mirror (P3); mark API switch, unit tests, backoff done

This commit is contained in:
FuelBoard Contributor
2026-08-13 14:04:58 +01:00
parent 2d070fa3ba
commit 61bb61d802
+15 -19
View File
@@ -9,27 +9,8 @@ Status: TODO / IN PROGRESS / DONE / BLOCKED.
--- ---
## P0 — Next build
- [ ] **Switch dataset to govuk API data** (BLOCKED on credentials)
Register at developer.fuel-finder.service.gov.uk (GOV.UK One Login / OAuth 2.0).
Relay already supports an OAuth provider upgrade path — `client_id`/`client_secret`
go into relay `.env`, never into the IPA. Live API replaces the hourly CSV mirror;
endpoint/schema mapping (E5/E10/DIESEL → FuelType) already proven in
`FuelPriceProvider.swift`. Until credentials arrive, the CSV mirror stays.
Any credentials received must be treated as secrets ([REDACTED] storage).
## P1 — Soon ## P1 — Soon
- [ ] **Unit test target for the app** — XCTest target covering:
- `FuelStore.sanitizedStationTitle` (title-case chunks, Sainsbury's apostrophe,
acronyms BP/MFG/ASDA/MOTO, hyphen/paren chunks, mixed-case passthrough)
- decode price guard: grades outside 50–500 pence/litre dropped
(`FuelPriceProvider.allPrices` + legacy `price` fallback)
- RAG thresholds (≤1.5p green / ≤4p amber / >4p red)
- Cheapest-vs-Closest sort + delta/TOP baseline (cheapest-within-radius both modes)
- miles→km and km→miles conversions (× 1.60934 / × 0.621371)
- [ ] **Backlog hygiene** — mark implemented items DONE, prune obsolete entries
- [ ] **EV charging?** — National Chargepoint Registry as a 4th "Charging" tab - [ ] **EV charging?** — National Chargepoint Registry as a 4th "Charging" tab
(second relay endpoint, ~40k+ UK chargers, OGL, connector-type filter) vs fuel-only. (second relay endpoint, ~40k+ UK chargers, OGL, connector-type filter) vs fuel-only.
@@ -52,6 +33,12 @@ Status: TODO / IN PROGRESS / DONE / BLOCKED.
## P3 — Ideas / Research ## P3 — Ideas / Research
- [ ] **Production data mirror (GitHub)** — relay pushes the synced dump
(`stations.json` + `latest.json` version pointer) to a PUBLIC GitHub repo; the
app fetches `raw.githubusercontent.com` with the LAN relay as fallback source.
Public repo required for App Review (reviewer must fetch the data themselves);
HTTPS/ATS fine; plain JSON data is not "remote code" (2.5.2-safe); bundle a small
fallback dump so the app never demos empty. Needs GitHub PAT (aptonline account).
- [ ] **Fuel-price prediction** — trend from historical dumps (relay could keep a - [ ] **Fuel-price prediction** — trend from historical dumps (relay could keep a
rolling archive) to show "price tends up/down". rolling archive) to show "price tends up/down".
- [ ] **Price alerts for a specific station** — notify when a starred station's - [ ] **Price alerts for a specific station** — notify when a starred station's
@@ -63,6 +50,15 @@ Status: TODO / IN PROGRESS / DONE / BLOCKED.
## Done (recent) ## Done (recent)
- [x] Switch dataset to govuk API data — official Fuel Finder OAuth API via
relay-api :8789 (source: api, ~8,012 stations); app baseURL → :8789; credentials
live in relay `.env` only, never in the IPA
- [x] Unit test target for the app — FuelBoardShared XCTest target, 37 tests
(title sanitizer, decode price guard, RAG thresholds, cheapest/closest baseline,
miles↔km)
- [x] Backlog hygiene — implemented items marked DONE, obsolete pruned
- [x] Sync retry with exponential backoff — relay-api retries failed syncs
15s→15min cap; `/health` exposes retry state (`6a58275`)
- [x] England-wide full-UK dump, on-device filtering (relay `142061b`, app `cf9765b`) - [x] England-wide full-UK dump, on-device filtering (relay `142061b`, app `cf9765b`)
- [x] Cache-first, 12 h gate, pull-to-refresh only - [x] Cache-first, 12 h gate, pull-to-refresh only
- [x] Distance filter 5/10/15 miles, local-only changes (no re-fetch) - [x] Distance filter 5/10/15 miles, local-only changes (no re-fetch)