Skip to content

fix(transit): warn of missing departures only for sources that leave gaps - #730

Merged
Medformatik merged 1 commit into
mainfrom
fix/transit-partial-board-sources
Oct 31, 2026
Merged

Medformatik merged 1 commit into
mainfrom
fix/transit-partial-board-sources

Conversation

@Medformatik

Copy link
Copy Markdown
Collaborator

Summary

Part of #401. Every station board around Köln said "Some departures may be missing", although every linked stop answered.

Why. A board first searches every transit provider covering about 100 km around the place for its stops. If any of them fails, or is in health cooldown, the board is marked partial. Around Köln, five providers fail on every request:

Provider What fails
DB SmartRBL "Invalid version". The transport-apis catalogue writes its HAFAS protocol version as version, and we only read ver.
AVV (Aachen) "Invalid version". Its catalogue entry states no version.
mobil.nrw (nrw.hafas.de) The hostname no longer resolves. hafas-client's profile uses the same host.
DB Regio "Streckenagent" (bnav.hafas.de) The hostname no longer resolves.
CFL 503 on every request, website included.

The coverage boxes are also coarse. CFL's spans Europe because it sells international trains, though Luxembourg is its home network.

Changes:

  • Protocol version: an entry's version is read where it gives no ver. AVV, which states neither, gets 1.26 from hafas-client's own AVV profile. Both answer again: SmartRBL contributes "Deutsche Bahn AG" stops, and AVV contributes Aachen's.
  • Retired endpoints: mobil.nrw and DB Regio are left out of the registry, with the hosts and the date checked. CFL stays, because a 503 may be temporary.
  • Gaps only where a source has data of its own:
    • Transit providers can state a home area within their coverage. Registry entries use their live coverage, else their regular coverage; for example, ÖBB's is Austria and CFL's is Luxembourg.
    • A place's stop search marks the board partial only when a failing provider's home area holds the place. Providers without a home area count as before.
    • A Köln board isn't flagged when CFL or ÖBB fails: they add only trains that other sources there list too. It is flagged when KVB fails.
    • Without a place (plain stop search), any failure still counts. When no provider answers, the search still rejects.

Before (openmapx.com): the warning, while every linked stop answers.

Before: Köln Messe/Deutz departures with "Some departures may be missing" and Retry

After: no warning, and AVV and Deutsche Bahn (SmartRBL) appear among the sources.

After: Köln Messe/Deutz departures without the warning, listing Aachener Verkehrsverbund and Deutsche Bahn AG as sources

The after view comes from a local web build against a local proxy (not committed). The proxy ran this branch's stop discovery and board merge with this branch's dynamic registry against the live providers. Transitous's stops and departures came from production, because it isn't part of the registry. Both screenshots predate #729, so the licence labels still show.

The same discovery for Köln Messe/Deutz, run against the live providers:

  • main: partial, with 6 providers failing (AVV, DB Regio, mobil.nrw, SmartRBL, CFL, stadtnavi) and 12 stops linked.
  • This branch: complete, with 23 stops linked. CFL and stadtnavi still failed, both outside their home areas. stadtnavi's failure is an artefact of the probe, which had no HTTP client; stadtnavi answers normally.

Known limits:

  • New linked stops: AVV names stops "Köln, Deutz …", so the existing name rule also links two nearby stops that aren't part of the station: Deutzer Freiheit and Gummersbacher Straße. KVB's "Deutz Technische Hochschule" and "Im Rheinpark" are already linked the same way on main. Tightening that rule is a separate change.
  • Upstream catalogue: AVV's missing version, SmartRBL's version key and the two dead endpoints belong upstream in transport-apis too. I haven't reported them.

Validation:

  • New tests cover:

    • stop search for a place: no gap from a failure outside the home area; a gap from one inside it, or from a provider without a home area, failing or cooling down; and still rejecting when none answers;
    • the registry leaving out the retired entries;
    • the protocol version from version, the AVV fallback, and ver taking precedence.

    Four fail against main's code.

  • Full Vitest run: 24,548 passed, 0 failed. check-types passes for apps/api, apps/web, packages/core and packages/integration-framework, and Biome is clean.

  • Not run locally: the docs build. No docs changed.

Release and upgrade impact

Product impact: ordinary
No package release: the built @openmapx/extension-cli and @openmapx/extension-contracts packages are byte-identical to main (both built and compared, 42 files); the changed shared code is the optional home field on the integration framework's TransitProvider coverage, which they don't ship. extension-contracts' type declarations order some union members differently between builds of the same commit, so the comparison used builds that came out in the same order.

…gaps

Every board around Köln said "Some departures may be missing": its stop
search counts any failing provider in a ~100 km box, and five there fail
on every request. SmartRBL and AVV failed on the HAFAS protocol version
(the catalogue writes SmartRBL's as "version", and AVV's states none);
both now answer. mobil.nrw and DB Regio's endpoints no longer exist and
are left out. A failure now marks a place's board partial only when the
place lies in the provider's home area, its live coverage: CFL failing
leaves no gaps in Köln.
@Medformatik Medformatik added the integration New or changed provider, source or backend integration label Oct 31, 2026
@Medformatik Medformatik self-assigned this Oct 31, 2026
@Medformatik
Medformatik enabled auto-merge (squash) October 31, 2026 22:43
@Medformatik
Medformatik merged commit 42f1c2b into main Oct 31, 2026
25 checks passed
@Medformatik
Medformatik deleted the fix/transit-partial-board-sources branch October 31, 2026 22:53
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

integration New or changed provider, source or backend integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant