Summary
The client flight-track hook defaults to MockClient unless VITE_FLIGHT_PROVIDER is explicitly set to opensky. In that default branch, track history is unavailable because MockClient.track() always returns null.
Evidence
Why this matters
- A missing or mis-set client env var changes the frontend from live provider mode to mock mode.
- Track-history functionality can appear broken or absent even while the rest of the map renders, making the failure easy to miss.
- This creates environment-dependent behavior that is not obvious from the UI.
Attack or failure scenario
A deployment omits VITE_FLIGHT_PROVIDER or uses a non-opensky value. Snapshot and tracking behavior diverge: parts of the flight UI rely on mock data assumptions, and track history silently resolves to null for every aircraft.
Root cause
Provider selection is driven by a fragile client-side env gate with a mock implementation as the default branch.
Recommended fix
- Make production provider selection explicit and fail closed when the configured provider is invalid.
- Do not default to a mock provider in production builds.
- Surface provider mode visibly in the UI or diagnostics.
- Add tests for provider selection and invalid env configuration.
Acceptance criteria
- Production builds cannot silently default to
MockClient.
- Invalid or missing provider config produces explicit failure or warning state.
- Track-history availability is deterministic across environments.
Suggested labels
- bug
- architecture
- production-readiness
Severity
High — a configuration slip can silently put the client on mock behavior and break track history without obvious operator feedback.
Confidence
Confirmed — the hook defaults to MockClient, and that client's track() implementation is a hardcoded null.
Summary
The client flight-track hook defaults to
MockClientunlessVITE_FLIGHT_PROVIDERis explicitly set toopensky. In that default branch, track history is unavailable becauseMockClient.track()always returnsnull.Evidence
client/src/modules/flights/hooks/useFlightTrack.ts#L7-L8selectsnew MockClient()unlessVITE_FLIGHT_PROVIDER === 'opensky'.client/src/core/providers/mock.client.ts#L37-L40implementstrack()asreturn null.null, so the UI can degrade silently depending on environment configuration.Why this matters
Attack or failure scenario
A deployment omits
VITE_FLIGHT_PROVIDERor uses a non-openskyvalue. Snapshot and tracking behavior diverge: parts of the flight UI rely on mock data assumptions, and track history silently resolves tonullfor every aircraft.Root cause
Provider selection is driven by a fragile client-side env gate with a mock implementation as the default branch.
Recommended fix
Acceptance criteria
MockClient.Suggested labels
Severity
High — a configuration slip can silently put the client on mock behavior and break track history without obvious operator feedback.
Confidence
Confirmed — the hook defaults to
MockClient, and that client'strack()implementation is a hardcodednull.