fix: avoid dead render aggregation message #28
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/w11-dead-render-message"
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 W11 from bugs.md.
InfoLive.Show.mount_valid/2now guards thesend(self(), :load_aggregations)withconnected?/1, matching the PubSub subscription guard directly above it. On the dead renderself()is the HTTP connection process with nohandle_infoclause, so the message previously sat in its mailbox across keep-alive requests. Connected LiveViews keep the existing refresh path unchanged.Verification: focused info_live tests passed (57), full suite passed (2235),
mix credo --strict, and commit hooks including Dialyzer passed.🤖 Skippy PR review
1 finding — none blocking.
lib/aprsme_web/live/info_live/show.ex:117Reviewed
1ccff690812b. Commentskippy reviewto re-run.@ -115,0 +114,4 @@# Only a connected LiveView process handles :load_aggregations. On the# dead render `self()` is the HTTP connection process, which has no# handler — the message would sit in its mailbox across keep-alive# requests. (The aggregations are computed above for the initial render;🔵 Suggestion — Comment claims the aggregations are computed for the initial render — they are not
Nothing above this point computes the aggregations: lines 108-109 assign
heard_by_stations: []andstations_heard_by: [], and the only writer ishandle_info(:load_aggregations, ...). So the dead render's HTML omits both sections entirely and they appear only after the connected mount fills them. Either say that plainly (the send is connected-only because the static render has no aggregation data), or, if JS-less clients/crawlers are meant to see those sections, compute them inmount/3whennot connected?(socket).The guard itself is correct and matches the
subscribeguard above.Resolved 1 of 1 earlier finding: the dead-render comment now says the two aggregation sections are omitted on the static render and only filled by the connected mount, which matches
heard_by_stations/stations_heard_bybeing assigned[]atshow.ex:108-109.Nothing new in
1ccff690812b..4e1894483f50(comment-only change).