Skip to content

Deep links and saved lists: a malformed value no longer locks the app - #69

Merged
davd-gzl merged 1 commit into
mainfrom
fix/crash-guards
Sep 29, 2026
Merged

davd-gzl merged 1 commit into
mainfrom
fix/crash-guards

Conversation

@davd-gzl

Copy link
Copy Markdown
Collaborator

7/10, high

Problem

One malformed value in a shared link or in the browser's saved lists makes the app unusable. A link with date=2026-10-1, or a saved favorite stored as null, throws inside initApp. The boot card then says "Couldn't load the data" and its Retry reloads the same URL, so the user never gets back in without editing the link or clearing site data.

queryFromParams passes date through unchecked, and loadFavorites and its two siblings only check that the stored value is an array. Both go back to the first build, ad68f09.

Fix

A date in a link must be a real calendar day and a time must read HH:MM. A bad departure date falls back to today, as an out-of-window one already did, other bad values are dropped, and the address bar is corrected in place to match the screen. Saved favorites, watched routes and trips are checked entry by entry, so one malformed entry is dropped rather than the whole list.

Two changes ride along. A crash after the data has loaded now says "This page couldn't be opened" and retries without the link, since reloading the same link can only fail again. Station names in a link resolve whatever their case, accents or St and Saint spelling, and a name matching nothing says "Unknown station" instead of "No MAX seat", which sent people to add connections for a place that does not exist.

Resolution is an exact match after that normalising, with no substring fallback, so a typo is reported rather than guessed.

A link with date=2026-10-1 or a stored favorite of null threw inside
initApp, and the boot card blamed the data and retried the same URL.

URL dates must be real YYYY-MM-DD days and times HH:MM; anything else
falls back like an out-of-window date, and the address bar is corrected
in place to match the screen. Stored favorites, watched routes and
trips are checked per entry and a malformed one is dropped.

Station names in a link resolve regardless of case, accents or St
spelling, preferring the station that has trains (LILLE resolves to
LILLE (intramuros)). A name matching nothing says Unknown station
instead of No MAX seat.

The boot card now says the page could not open when the data loaded
but the app failed, and its Retry opens the app without the link.
@davd-gzl
davd-gzl merged commit f40e87b into main Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant