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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user