Settings About: data source section (connection, station count, GOV.UK update time)

- Relay envelope now carries source (api|csv), stations_count, and
  data_updated (freshest price_last_updated the GOV.UK server reports,
  independent of relay sync time).
- App decodes the new envelope metadata (RelayMeta), persists it after
  each full fetch, and shows it in Settings → About → Data source:
  Connection (API/CSV), Stations count, Data updated (local-formatted).
- Older relays without the fields decode cleanly (nil meta → em-dash).
- 2 new tests for meta decode + absent-meta tolerance; 37/37 pass.
This commit is contained in:
FuelBoard Contributor
2026-08-12 16:23:41 +01:00
parent a5a95cbb03
commit fccd0c07ef
5 changed files with 162 additions and 1 deletions
+5
View File
@@ -293,6 +293,11 @@ struct ContentView: View {
stations = fetched
FuelStore.saveStations(fetched)
FuelStore.saveLastRefresh()
// Persist relay envelope metadata (source, station count, GOV.UK
// dataset update time) for the Settings About section.
if let meta = RelayFuelProvider.latestMeta {
FuelStore.saveRelayMeta(meta)
}
// Keep the keychain favourites fresh with the new prices the
// widget's Favourites mode reads them from keychain (the only
// channel shared on SideStore free), so stale star-time snapshots