{"version":"2.1.324","anchor":"heartbeat-gap-tracking-in-the-worker-session-client","canonical_anchor":"heartbeat-gap-tracking-in-the-worker-session-client","heading":"Remote-session heartbeats now tracked for gaps","tier":"internal","area":"Sessions","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324\/e\/heartbeat-gap-tracking-in-the-worker-session-client","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324","markdown":"### Remote-session heartbeats now tracked for gaps\n\nA heartbeatGap tracker now follows the heartbeats remote sessions send, noting each one sent and each one accepted\n\n**What**\n\nA remote session regularly sends a small \"still alive\" message, called a heartbeat, to show the connection is working. A new `heartbeatGap` tracker now follows these messages.\n\n- The worker session client accepts an optional `heartbeatGap` tracker. On each heartbeat to `\/worker\/heartbeat`, it calls `noteSent` with the number of seconds the session has been idle.\n\n- The client also gains the fields `unheard` and `lastStreamEventDropAtMs`.\n\n- The bridge passes the tracker through to the session transport (the part that carries messages). It calls `noteAccepted` when a heartbeat succeeds.\n\n- The timestamp arguments for heartbeats were swapped, which changes which time is compared to judge success and which time is recorded as the success time.\n\n**Why**\n\nNothing changes in what you do. The tracking makes it easier to tell when a remote session's connection goes quiet or drops heartbeats.\n\n- Area: Sessions\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}