towerops/lib/towerops_web
Graham McIntire 9cb4c59638 dialyzer: replace suppressions with real fixes where possible
Changes to eliminate @dialyzer suppressions by fixing underlying causes:

NIF stubs (towerops_native.ex, mib_translator.ex):
- Change stubs to :erlang.nif_error(:nif_not_loaded) (no_return type).
  Real NIF replaces stubs at load time; calls to unloaded stubs now fail
  loudly instead of returning fake data. Lets dialyzer trust @spec.
- Remove @dialyzer :nowarn_function on three NIFs and on translate/1.

Discovery sync_* functions (snmp/discovery.ex, channels/agent_channel.ex):
- agent_channel passes %{device_id: _, interfaces: _} and %{id: _} maps
  into Discovery.sync_ip_addresses/sync_processors/sync_storage, which
  @spec'd only %Device{}. Add narrow map-type unions (ip_sync_device,
  snmp_device_ref) reflecting what the functions actually access.
- Remove @dialyzer :nowarn_function on three agent_channel helpers.

remote_ip.ex — real bug caught and fixed:
- `:ranch.get_addr(socket.transport_pid)` was always raising since
  Bandit uses ThousandIsland, not Ranch; the rescue _ -> nil silently
  returned nil every time. Switched to Phoenix's documented
  :peer_data connect_info (already enabled in endpoint.ex) via
  socket.assigns; remote IP now actually works.
- Remove remote_ip.ex entry from .dialyzer_ignore.exs.

Accounts / Organizations (Ecto.Multi opacity):
- Add @specs to Multi-building helpers, refactor into pipe chains.
- 6 @dialyzer :nowarn_function → 0, but 7 :no_opaque remain. Root
  cause is upstream: Ecto.Multi.new/0 returns a struct with a literal
  %MapSet{} whose @opaque internal representation trips dialyzer on
  every subsequent Multi.* call. Unfixable without an Ecto patch or
  bypassing Multi entirely. Comments document the specific upstream
  issue rather than a vague "Ecto.Multi opacity" claim.

Devices.ex:
- Adding @specs made it worse (call_without_opaque → contract_with_
  opaque); inlining the Multi didn't help either — same MapSet root
  cause. Suppression kept with a sharper comment.
2026-04-21 11:01:30 -05:00
..
channels dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
components ui: hide weathermap navigation links (#174) 2026-03-25 16:40:11 -05:00
controllers dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
graphql dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
helpers feat: add status emoji to page titles 2026-03-06 14:45:02 -06:00
live dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
plugs dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
changelog_parser.ex remove-gleam (#218) 2026-03-29 11:03:20 -05:00
endpoint.ex feat: add Accept: text/markdown content negotiation for agent compatibility 2026-04-17 14:14:31 -05:00
gettext.ex init 2025-12-21 11:10:43 -06:00
gettext_helpers.ex feat: migrate email templates to gettext (Phase 2 - Emails) 2026-02-02 09:48:30 -06:00
graphql_socket.ex add mobile token auth to GraphQL endpoint (#48) 2026-03-16 15:23:07 -05:00
permissions.ex i18n: add Spanish locale with full translations, language selector, and locale hook 2026-02-14 17:44:01 -06:00
plug_exceptions.ex handle exceptions gracefully on api endpoints 2026-02-04 12:18:14 -06:00
remote_ip.ex dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
router.ex feat: add /.well-known discovery endpoints for agent readiness 2026-04-17 14:06:51 -05:00
scoped_resource.ex dialyzer: expand PLT, drop blanket codebase suppression 2026-04-21 09:33:22 -05:00
telemetry.ex fix: add Oban config to dev.exs and replace Exq telemetry with Oban 2026-01-24 16:39:45 -06:00
telemetry_filter.ex fix: suppress health check logs and downgrade CI artifacts to v3 2026-03-05 15:54:47 -06:00
user_auth.ex dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00