fix: avoid dead render aggregation message #28

Merged
graham merged 2 commits from fix/w11-dead-render-message into main 2026-09-15 16:33:22 -05:00
Owner

Fixes W11 from bugs.md.

InfoLive.Show.mount_valid/2 now guards the send(self(), :load_aggregations) with connected?/1, matching the PubSub subscription guard directly above it. On the dead render self() is the HTTP connection process with no handle_info clause, 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.

Fixes W11 from bugs.md. `InfoLive.Show.mount_valid/2` now guards the `send(self(), :load_aggregations)` with `connected?/1`, matching the PubSub subscription guard directly above it. On the dead render `self()` is the HTTP connection process with no `handle_info` clause, 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.
fix: avoid dead render aggregation message
All checks were successful
Elixir CI / Dialyzer (pull_request) Successful in 41s
skippy-bot/review Skippy review: clean — 1 non-blocking note open
Elixir CI / Build and test (pull_request) Successful in 1m44s
Elixir CI / Build and Push Docker Image (pull_request) Has been skipped
1ccff69081
skippy-bot left a comment

🤖 Skippy PR review

1 finding — none blocking.

Severity Location Issue
🔵 Suggestion lib/aprsme_web/live/info_live/show.ex:117 Comment claims the aggregations are computed for the initial render — they are not

Reviewed 1ccff690812b. Comment skippy review to re-run.

### 🤖 Skippy PR review **1 finding** — none blocking. | Severity | Location | Issue | | --- | --- | --- | | 🔵 Suggestion | `lib/aprsme_web/live/info_live/show.ex:117` | Comment claims the aggregations are computed for the initial render — they are not | <sub>Reviewed `1ccff690812b`. Comment `skippy review` to re-run.</sub> <!-- skippy-pr-review -->
@ -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;
First-time contributor

🔵 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: [] and stations_heard_by: [], and the only writer is handle_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 in mount/3 when not connected?(socket).

The guard itself is correct and matches the subscribe guard above.

**🔵 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: []` and `stations_heard_by: []`, and the only writer is `handle_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 in `mount/3` when `not connected?(socket)`. The guard itself is correct and matches the `subscribe` guard above.
skippy-bot marked this conversation as resolved
fix: correct dead-render comment about aggregation data
All checks were successful
skippy-bot/review Skippy review: clean — no open findings
Elixir CI / Build and test (pull_request) Successful in 59s
Elixir CI / Dialyzer (pull_request) Successful in 40s
Elixir CI / Build and Push Docker Image (pull_request) Has been skipped
4e1894483f
First-time contributor

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_by being assigned [] at show.ex:108-109.

Nothing new in 1ccff690812b..4e1894483f50 (comment-only change).

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_by` being assigned `[]` at `show.ex:108-109`. Nothing new in `1ccff690812b..4e1894483f50` (comment-only change). <!-- skippy-pr-review -->
graham merged commit cc49c6e4b6 into main 2026-09-15 16:33:22 -05:00
graham deleted branch fix/w11-dead-render-message 2026-09-15 16:33:22 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
graham/aprs.me!28
No description provided.