Production keeps one day of packets while the map offers a one week trail and the info page aggregates 30 days #51
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
The deployment sets
PACKET_RETENTION_DAYSto 1, sodrop_old_partitionskeeps only yesterday and today. The map still offers 48 hour and 1 week trails, and/info/:callsignbuilds its stations-heard tables from a 30 day window. Choosing 1 Week draws about a day and a half of track and then stops with no indication that history was pruned, and the info page's first heard, last heard and packet counts can only ever reflect about two days.Evidence
At
2f150f66:k8s/deployment.yaml:175setsPACKET_RETENTION_DAYSand:176isvalue: "1".config/runtime.exs:284reads that value with a default of 7, so production is the deployment's choice, not the code default.lib/aprsme/partition_manager.ex:90computes the drop cutoff as now minus retention, and:98drops any partition whose upper bound is at or before it.lib/aprsme_web/live/map_live/index.ex:1060offers a 48 hour option and:1063a 1 Week option, applied as a server cut atlib/aprsme_web/live/map_live/index.ex:47.lib/aprsme_web/live/info_live/show.ex:428buildsone_month_ago = DateTime.shift(DateTime.utc_now(), day: -30).Expected
Either retention covers the longest window the UI offers (7 days or more in the deployment), or the trail selector and the info page cap their windows at the configured retention and say so. Offering a window the database cannot answer is the defect.
How to verify
In production,
SELECT min(received_at) FROM packets, then load/?trail=168and note that the oldest trail point is about a day old. A cheap regression test asserts every valueparse_trail_duration/1accepts is withinpacket_retention_days.Acceptance criteria
Effort: S
Lens: product