You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Critical proxy flaws allow access to internal services, while authentication handling can leak credentials and retain protected responses after credentials change.
Check every resolved address against private and reserved IPv4/IPv6 ranges inside the connection's own DNS lookup (undici agent), so redirects and DNS rebinding cannot reach internal hosts. Follow redirects manually, sending credentials only to the same origin, and refuse redirects on the OAuth token request. Refuse feeds over 50 MB and token responses over 1 MB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read GBFS 3.0 num_vehicles_available, treat legacy 0/1 flags as booleans, fall back to ride_allowed for 2.2 geofencing rules, and stop stringifying objects. Resolve station_status errors by station_id, count error badges per record instead of per coordinate, skip non-finite or out-of-range coordinates, keep a close button on the expanded map in loading, error and empty states, and count an error repeated across language copies once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Key in-memory caches by a per-credentials scope, never persist authenticated files to localStorage, and expire in-memory file entries. Only the latest feed load may commit data or loading state, a new URL clears the previous feed, and choosing a sample feed clears credentials.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add an issue parameter (keyword plus a short hash of the message) so links open the right error when several share a path. Links without it still resolve by path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore CoveredAreaMap from main so feed detail pages do not show the new GBFS visualization, and drop its now unused translation keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A JSON body of null, an array or a scalar parsed, then crashed the
destructuring with an unhandled 500. It now gets a 400.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Errors point at record indices in their own language copy of a file,
but the map always loaded the feed's first language, so an error could
be drawn on another station. The map now loads the report's language,
the overlay keeps only that language's errors, and the expanded map
resolves linked errors in it.
Also from review:
- count a file as valid from its own errors, before language repeats
are merged
- fall back to 'other' for inherited form factor names
- drop geofencing zones without a polygon geometry
- stop formatting the whole file when opening an error's details
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failed upstream responses leave their Undici bodies unread and uncancelled, keeping streams and connections occupied until the timeout. Cancel the body before returning this error; also cancel tokenResp.body before throwing on the OAuth failure path at line 156.
Filter malformed vehicle type entries before building station facts
src/app/components/GbfsMap/popupFacts.ts:95
Checking only that the parsed value is an array does not make its entries safe. parseStationStatuses preserves malformed vehicle_types_available entries, so a feed containing [null] reaches the map popup and throws when labels access t.vehicle_type_id outside the try/catch. Validate or filter the entries before building the station facts.
Skip malformed polygon coordinates when calculating bounds
The parser accepts polygons based only on their geometry type, so an invalid geofencing zone with coordinates: null reaches this code. It throws on flat(), even when valid station data exists, breaking the map's bounds calculation. Skip malformed coordinate arrays and non-finite positions instead of letting one invalid zone break visualization.
Include credentials when reusing validation results
Reusing validation by URL alone ignores the credentials used for that result. After leaving the validator and reopening its map, the layout's auth context can be empty while Redux still holds an authenticated result for the same URL. The map then displays that old report instead of validating with the current credentials. Compare auth as well, as ValidationState does, and rerun the effect when auth changes.
Bound the cache and prune expired entries on insertion
The TTL only removes an entry when that exact URL, credential scope and language is requested again, so inspecting different feeds retains their parsed data for the tab's lifetime. Bound the cache and prune expired entries on insertion to prevent large feeds accumulating in memory. The same issue affects the JSON cache in src/app/screens/GbfsValidator/components/errorDetails/useFileJson.ts:22.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Adds the updated version of the gbfs validator to the mobilitydatabase (currently behind a feature flag)
Expected behavior:
Users will be able to validate their gbfs feeds on the mobilitydatabase while gaining key insights about their data
Testing tips:
/gbfs-validator)Notes
Please make sure these boxes are checked before submitting your pull request - thanks!
yarn testto make sure you didn't break anything