{
  "id": 20025083,
  "title": "Node.js Lease Presence Beats Disconnect Events After Realtime Network Drops",
  "url": "https://urgent.news/2026/11/14/node-js-lease-presence-beats-disconnect-events-after-realtime-network",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-14T18:26:11.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/peterparker8991/nodejs-lease-presence-beats-disconnect-events-after-realtime-network-drops-c4"
  },
  "original_language": "en",
  "account": null,
  "summary": "The article discusses the issue of ghost users appearing in realtime presence after a network drop when using Node.js. The root cause of this problem is that servers typically detect graceful closures quickly, but network drops are different as the client cannot send a final message when connectivity is lost. This results in the client not being able to transmit a leave event, which can create the illusion of ghost users. To address this issue, the article suggests treating presence as a short lease owned by one newsroom editor session, rather than assuming that a disconnect event must erase the presence. This approach involves using a session-scoped lease with a random presence token that is restricted to one document, one user, one session, and a short expiry. By doing so, the design becomes more robust and avoids ambiguity when multiple tabs are opened. Additionally, the article recommends replaying awkward sequences to understand how the system behaves under different conditions and to ensure that the lease is properly managed.",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}