towerops/test/towerops_web
Graham McIntire 303c64ceae fix: set last_heartbeat_db_update on agent join to fix offline detection (#142)
When an agent joins, we update last_seen_at in the database but don't set
last_heartbeat_db_update in the socket. This causes the heartbeat throttling
logic to be out of sync:

- On join: DB updated, but last_heartbeat_db_update not set (nil)
- First heartbeat: Updates DB again because last_heartbeat_db_update is nil
- Subsequent heartbeats: Check if >30s since last DB update
- Problem: last_heartbeat_db_update tracks the first heartbeat, not the join DB update

This manifests when Phoenix recompiles during development - the channel process
continues running with old socket assigns, and if last_heartbeat_db_update is
recent, heartbeats won't update the DB. After 10+ minutes without DB updates,
the agent appears offline even though it's still connected.

Fix: Set last_heartbeat_db_update when we update the DB on join, so the
throttling logic accurately tracks the most recent DB update.

Reviewed-on: graham/towerops-web#142
2026-03-24 12:19:13 -05:00
..
channels fix: set last_heartbeat_db_update on agent join to fix offline detection (#142) 2026-03-24 12:19:13 -05:00
components Fix footer positioning + add layout tests 2026-03-13 13:57:55 -05:00
controllers add auto ICMP ping check for all devices (#68) 2026-03-17 17:55:23 -05:00
graphql improve agent status display and fix two pre-existing test failures (#83) 2026-03-19 11:43:42 -05:00
helpers feat: add 12/24-hour time format setting with consistent timezone display 2026-02-13 15:16:29 -06:00
integration Merge remote-tracking branch 'origin/main' into feature/preseem-integration 2026-02-13 09:11:45 -06:00
live Fix critical bugs, memory leaks, and N+1 queries (#132) 2026-03-23 17:03:41 -05:00
plugs fix failing tests: ping check config and whitelist cache race (#55) 2026-03-17 08:11:36 -05:00
gleam_changelog_parser_test.exs Rewrite polling_offset, changelog_parser, and user_agent_parser in Gleam (#103) 2026-03-21 10:11:06 -05:00
graphql_socket_test.exs add mobile token auth to GraphQL endpoint (#48) 2026-03-16 15:23:07 -05:00
permissions_test.exs fix snmp v3 test 2026-02-06 10:21:54 -06:00
plug_exceptions_test.exs handle exceptions gracefully on api endpoints 2026-02-04 12:18:14 -06:00
remote_ip_test.exs perf: disable Req retry for faster error tests 2026-03-10 16:19:31 -05:00
telemetry_filter_test.exs Add GeoIP import HTTP tests 2026-03-10 16:02:49 -05:00
user_auth_test.exs perf(tests): remove/reduce Process.sleep calls for faster tests 2026-03-06 07:57:30 -06:00