mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
Merge upstream/main: bikeshare Toronto and scoped city failures
Upstream's #641 (bikeshare Toronto, city failures scoped to range with partial outages read DEGRADED/STALE) replaced the layer-level GBFS error strings this branch had msg()-marked, in the two paths that conflicted. - ingestion.js/viewport.js taken as upstream's per-city _failedCityIds tracking; the layer-level error assignments are gone. - 'GBFS fetch error' still reaches the panel via stats.error from controls.js, so its mark moved there (translateFeedError keeps translating it). - 'GBFS status update failed' no longer exists anywhere: pruned from es/ru and from the layerStatusText SITES table, which now pins the controls.js site instead of the removed ones. Also brings #581 (upstream-read caps, OpenSky 429 cooldown) - no i18n surface. npm run i18n: complete (2553), no unmarked strings. npm test: only the pre-existing environmental OPENAI_API_KEY leak in devFreshDotenv fails. Build passes.
This commit is contained in:
commit
6fe8327ccb
30 files changed
+1102
-96
No files matched your search
Vendored
+17
-3
@@ -1,4 +1,4 @@
|
||||
import { t } from '../../i18n/index.js';
|
||||
import { msg, t } from '../../i18n/index.js';
|
||||
import { STATUS_POLL_MS } from './policy.js';
|
||||
|
||||
export function createControls({ state: layerState, services, parts, source }) {
|
||||
@@ -57,7 +57,7 @@ export function createControls({ state: layerState, services, parts, source }) {
|
||||
|
||||
/**
|
||||
* Return current layer statistics for the UI status display.
|
||||
* @returns {{ count: number, lastUpdate: number|null, loading: boolean, loadingLabel?: string, error?: string }}
|
||||
* @returns {{ count: number, lastUpdate: number|null, loading: boolean, loadingLabel?: string, error?: string, degraded?: boolean, stale?: boolean }}
|
||||
*/
|
||||
getStats() {
|
||||
const stats = {
|
||||
@@ -73,7 +73,21 @@ export function createControls({ state: layerState, services, parts, source }) {
|
||||
})
|
||||
: t('scanning nearby systems...');
|
||||
}
|
||||
if (layerState._error) stats.error = layerState._error;
|
||||
// A failed city is only the layer's failure when it left nothing on the
|
||||
// map. While other cities still render, the partial failure reads
|
||||
// DEGRADED; when every in-range city failed and only previously drawn
|
||||
// points remain, they read STALE.
|
||||
if (layerState._failedCityIds.size > 0) {
|
||||
if (layerState._stationRenderMap.size === 0) {
|
||||
stats.error = msg('GBFS fetch error');
|
||||
} else {
|
||||
stats.degraded = true;
|
||||
const allFailed = Array.from(layerState._activeCityIds).every(
|
||||
(cityId) => layerState._failedCityIds.has(cityId),
|
||||
);
|
||||
if (allFailed) stats.stale = true;
|
||||
}
|
||||
}
|
||||
return stats;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user