Commit graph

1339 commits

Author SHA1 Message Date
4a00868c2a
test: reset rate-limiter ETS between api controller tests to prevent 429 flakes 2026-04-23 17:22:23 -05:00
dac0198825
test: add MapLive.Index integration tests with real DB packets 2026-04-23 17:22:23 -05:00
FluxCD
33cc390e65 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776982337-30d852f [skip ci] 2026-04-23 22:12:23 +00:00
30d852fbc5
test: info_live full render with various packet types 2026-04-23 17:11:50 -05:00
32d4b6daff
test: cover PacketDistributor GenServer callbacks 2026-04-23 17:11:50 -05:00
FluxCD
b98ecd5432 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776981986-3eec544 [skip ci] 2026-04-23 22:06:32 +00:00
3eec54439b
test: add MapLive.Index zoom threshold and tracking tests 2026-04-23 17:05:59 -05:00
b4d0093a8f
test: add MapLive.Index URL param and callsign route tests 2026-04-23 17:05:59 -05:00
adb304e069
test: cover HistoricalLoader pure functions 2026-04-23 17:05:59 -05:00
FluxCD
c0dfa30cff chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776981517-0a1c5aa [skip ci] 2026-04-23 21:58:42 +00:00
0a1c5aa61d
test: add ApiDocsLive full-packet path to exercise format functions 2026-04-23 16:58:13 -05:00
e3dfdf03ba
test: cover PacketConsumer init and process_batch callbacks 2026-04-23 16:58:13 -05:00
f0db8f711e
test: add MapLive.Index message handler tests 2026-04-23 16:58:13 -05:00
FluxCD
87b1e5f888 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776981129-b6adf64 [skip ci] 2026-04-23 21:52:15 +00:00
b6adf64dbd
test: add MapLive.Index event-handler integration tests 2026-04-23 16:51:42 -05:00
FluxCD
65c53302f5 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776981018-089ea1f [skip ci] 2026-04-23 21:50:24 +00:00
089ea1f4fb
test: expand Packets tests with positions and latest-packet helpers 2026-04-23 16:49:54 -05:00
91c9220a2d
test: cover ThemeManager selector, ApiDocsLive packet path and InfoLive Show integration 2026-04-23 16:49:54 -05:00
49374fdbc3
test: expand Accounts and PartitionManager coverage 2026-04-23 16:49:54 -05:00
a843c91191
test: expand CoreComponents coverage for modal, table, list, back, simple_form 2026-04-23 16:49:54 -05:00
FluxCD
74cfb52808 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776980473-a5b2c4b [skip ci] 2026-04-23 21:41:19 +00:00
a5b2c4bccb
test: cover UserAuth, StatusLive handlers and UserNotifier 2026-04-23 16:40:47 -05:00
FluxCD
e5a910c22b chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776980185-46e7101 [skip ci] 2026-04-23 21:36:32 +00:00
46e71019de
test: expand coverage for Layouts, DeviceCache, Components and others 2026-04-23 16:36:01 -05:00
FluxCD
006f9ab98b chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776979875-4173125 [skip ci] 2026-04-23 21:31:21 +00:00
41731257e6
test: cover auth LiveViews, PacketReplay, ShutdownHandler and more 2026-04-23 16:30:51 -05:00
FluxCD
3ab167777e chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776979144-16d2e92 [skip ci] 2026-04-23 21:22:15 +00:00
16d2e929c0
test: push coverage to 70% with more CoreComponents and PostgresNotifier
- CoreComponents.input/1: expanded coverage to include the select,
  textarea, generic-text, and unchecked-checkbox branches, plus
  error-vs-no-error border styling.
- PostgresNotifier: handle_info forwards pg_notify payload to
  Aprsme.PubSub and ignores unrelated messages.

Coverage 69.56 → 70.11%.
2026-04-23 16:18:04 -05:00
FluxCD
5363b2cb69 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776979015-fa893dd [skip ci] 2026-04-23 21:17:22 +00:00
fa893dd12e
test: cover ErrorHTML, Layouts, MapLive.Components, CoreComponents, Accounts
- ErrorHTML: explicit 400 path + 401/403/999 delegation.
- Layouts.body_class/1 returns the expected light/dark theme classes.
- MapLive.Components: map_container + slideover_panel exercising all
  connection_status variants, loading state, tracked_callsign clear
  button, and view-mode radios.
- CoreComponents: icon (found + fallback), button, label, error,
  flash (info + error + close=false), checkbox input, JS composers.
- Accounts: get_user_by_email{_and_password}, get_user!, register_user
  happy-path + error paths, change_* changesets, session-token
  round-trip.

Refactor: DeviceIdentification.maybe_refresh_devices splits its nested
logic into fetch_most_recent_device/0, to_datetime/1, and
refresh_if_stale/2 — each a multi-clause function matching on shape.

Coverage 68.28 → 69.56%.
2026-04-23 16:16:31 -05:00
FluxCD
6edc401168 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776975272-ab0204f [skip ci] 2026-04-23 20:14:38 +00:00
ab0204f3dc
test: add StreamData properties for Aprsme.GeoUtils
Four properties exercise haversine_distance / significant_movement?:

- non-negativity across any in-range coordinate pair
- symmetry: d(a, b) == d(b, a) within a tight tolerance
- identity: d(p, p) == 0.0
- significance agrees with (haversine > threshold) for any integer
  threshold in 1..1000

Total: +4 properties, coverage stays clean (dialyzer: 0 new errors).
2026-04-23 15:14:12 -05:00
FluxCD
8edc4bb4c7 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776974614-c90a76d [skip ci] 2026-04-23 20:04:00 +00:00
c90a76df04
refactor: CoordinateUtils.get_coordinates_from_mic_e uses guarded clauses
- get_coordinates_from_mic_e: replace two inline `if direction == ...`
  rebinds with a reusable apply_hemisphere_sign/3 helper; the final
  range check becomes maybe_return_coords/2 with a guarded clause that
  yields {lat, lon} or {nil, nil}.
- has_position_data?: the boolean short-circuit collapses from an
  explicit if/else to a single `or` expression.

All 37 CoordinateUtils tests (4 properties) still pass.
2026-04-23 15:03:09 -05:00
FluxCD
d07758a3f4 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776974278-48943cd [skip ci] 2026-04-23 19:58:23 +00:00
48943cdc52
refactor: Is.get_status pattern-matches on process presence
The original get_status/0 had a nested case/try that duplicated the
"disconnected" status map across two branches. Split into:

- status_from/1 with nil + is_pid heads for the "no GenServer" and
  "GenServer alive" paths. The alive path isolates the catch :exit, _
  fallback for a non-responding process.
- disconnected_status/1 builds the shared status map once, parameterised
  on the default server string to preserve the original branch-specific
  fallback behavior.

Removes ~20 duplicated lines; all 61 Is tests still pass.
2026-04-23 14:57:38 -05:00
FluxCD
f86c185f27 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776974190-401d43b [skip ci] 2026-04-23 19:57:17 +00:00
401d43be62
refactor: pattern-match LeaderElection init and cluster-status dispatch
- get_cluster_aprs_status: fetch_cluster_status/1 dispatches on the
  clustering flag — true fans out cluster-wide, false goes straight to
  the local Aprsme.Is status.
- init/1: extract schedule_initial_election/1 with true/false heads.
  The clustered branch sets up the check-and-backstop timers; the
  non-clustered branch queues an immediate election. Makes the two
  startup paths obvious from the function signatures.

No behavior change; all 17 LeaderElection tests still pass.
2026-04-23 14:56:07 -05:00
FluxCD
f943d887c5 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776974081-20d4637 [skip ci] 2026-04-23 19:55:30 +00:00
20d463794b
test: cover AprsmeWeb.Gettext helpers
- supported_locales/0 returns the declared ~w(en es de fr) list.
- put_locale/1 sets the Gettext process locale for each supported
  value and raises FunctionClauseError for unsupported input.

3 tests, async:false because they mutate process-wide Gettext state.
2026-04-23 14:54:16 -05:00
FluxCD
2b43e5b2a8 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776974000-cd1e577 [skip ci] 2026-04-23 19:53:48 +00:00
cd1e5771af
refactor: pattern-match Aprsme.Encoding helpers
- encoding_info/1 (binary clause): extract build_encoding_info/2 with
  true/false heads on String.valid?/1, so the valid-UTF-8 and invalid
  branches each own their map literal.
- try_utf8_conversion/1: convert_to_utf8/2 dispatches on String.valid?/1
  so the latin1 → UTF-8 fallback is a function head, not an inline if.

No behavior change; all 34 Encoding tests still pass.
2026-04-23 14:52:59 -05:00
FluxCD
1e55d106a0 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776973825-0cbe93f [skip ci] 2026-04-23 19:50:52 +00:00
0cbe93f8db
refactor: MobileChannel callsign search pattern via function dispatch
build_search_pattern/1 picks between SQL-wildcard (when the query
contains `*`) and prefix-match (SSID-friendly) forms via two function
heads instead of an inline `if`. The transform is now isolated and
obviously boolean-dispatched at the call site.
2026-04-23 14:50:03 -05:00
FluxCD
5a8f30916e chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776973130-9053eef [skip ci] 2026-04-23 19:39:17 +00:00
9053eef2c6
refactor: AprsSymbol.normalize_symbol_table pattern-matches on input
- Three-way cond (known-table / overlay-capable char / fallback) becomes
  three function heads: a guard-matched clause for the canonical
  "/"/"\\"/"]" tables, an is_binary clause that decides via regex match
  whether the input is a single alphanumeric overlay character, and a
  catch-all fallback.
2026-04-23 14:38:26 -05:00
FluxCD
2e5034f8c3 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776972493-a85f74e [skip ci] 2026-04-23 19:28:58 +00:00
a85f74ec3f
refactor: leadership_change handler pattern-matches instead of cond
Cluster.ConnectionManager.handle_info({:leadership_change, ...}) used
a cond on the (became_leader, node, connection_started) triple. Split
into handle_leadership_change/3 with three clauses:

- became_leader=true, us=true, not already started → start APRS-IS
- became_leader=false, us=true, already started → stop APRS-IS
- everything else → no-op

Makes the three state transitions visible in the function heads and
eliminates one more cond from the codebase.
2026-04-23 14:27:49 -05:00
FluxCD
c1c7e10d26 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1776972406-69152e8 [skip ci] 2026-04-23 19:27:12 +00:00
69152e86b3
refactor: split PacketProducer.handle_cast into pattern-matched heads
The original handle_cast had nested `if`s: outer branch on demand > 0,
inner branch on buffer-over-capacity. Split into:

- handle_cast with a `when demand > 0` guard for the hot path that
  skips the buffer entirely.
- A fallback clause that computes whether the new size would overflow
  and delegates to buffer_packet/3.
- buffer_packet/3 has two clauses — one for the drop-oldest path
  (with telemetry + warning) and one for the simple append path. Both
  share the final `maybe_activate_backpressure |> reply_noemit` step.

All 19 existing PacketProducer tests pass; dialyzer stays clean.
2026-04-23 14:26:23 -05:00