fix: validate weather callsign route segment #24
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/w7-weather-callsign-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes W7 from bugs.md.
WeatherLive.CallsignViewnow gates onCallsign.valid?/1before subscribing to the per-callsign topic or running the latest-packet and 500-row history queries, copying themount_valid/mount_invalidsplit fromInfoLive.Show. Invalid segments render the same "no recent weather data" state as an unknown-but-valid callsign, so the response reveals nothing.Verification: focused weather tests passed (19) including four new validation cases asserting zero database queries via telemetry, full suite passed (2239),
mix credo --strict, and commit hooks including Dialyzer passed.🤖 Skippy PR review
1 finding — none blocking.
lib/aprsme_web/live/weather_live/callsign_view.ex:90Reviewed
0f656dce8eb4. Commentskippy reviewto re-run.@ -73,0 +87,4 @@socket =socket|> assign(:callsign, "")🔵 Suggestion — Invalid segment still distinguishable from an absent station, with a dangling heading
The two assigns here are exactly what the empty state renders from, so the
mount_invalidpage is not byte-similar to the unknown-but-valid one:callsign_view.html.heex:352printsWeather for {@callsign}andlayouts/root.html.heex:35puts@page_titlestraight into<title>. Post-fix,/weather/.*returnsWeather for/<title>Weather</title>while/weather/Z9ZZZ-9returnsWeather for Z9ZZZ-9/<title>Weather for Z9ZZZ-9</title>— the invalid-vs-absent distinction the comment above says is not revealed (anyone diffing the two responses still gets it), plus a visibly broken heading with a trailing "for". No data leaks either way, so this is cosmetic, not a hole: if you want them indistinguishable, make the heading/title conditional on a non-blank@callsign(render plaingettext("Weather")when it is empty) instead of asserting the states match; if you keep the current shape, drop that clause from the comment.Resolved 1 of 1 earlier findings:
callsign_view.html.heex:352now guards the heading on a non-blank@callsignand renders a plain "Weather" for the invalid path, matchingpage_title, so the dangling "Weather for " heading/title is gone. 0 still open.Nothing new in
0f656dce..2e6cd506(the new commit only touches that empty state).