{
  "id": 13836739,
  "title": "The Silent Alert Bug: When Your Instant Push Exists but Never Fires",
  "url": "https://urgent.news/2026/10/12/the-silent-alert-bug-when-your-instant-push-exists-but-never-fires",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-12T01:01:35.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/mattleeee/the-silent-alert-bug-when-your-instant-push-exists-but-never-fires-3imc"
  },
  "original_language": "en",
  "account": "The issue at hand is not with the alert formatter itself, but rather with the fact that it is never invoked. A user reported that instant push notifications suddenly stopped working, yet the daily report was generated as usual and looked correct. The first assumption was that the problem lay within the transport layer, such as the push service, API key, or network. However, upon testing manually, a test push was sent successfully, revealing that the problem was not with the pipeline but rather with the code responsible for invoking the push.\n\nUpon examining the code, it was discovered that a function named `format_instant_alert` was present, which built a single-line push message for newly opened positions. This function was clean, tested, and correct for months. However, a closer inspection revealed that there were no calls to this function anywhere in the codebase. The function was essentially a dead code, as it was never invoked.\n\nThe real problem stemmed from the fact that the push notifications were wired into four separate code paths for opening positions. These paths included manual entry from the CLI, scheduled strategy execution, signal-driven entry from a webhook, and recovery/reconciliation after a restart. Each path contained copy-pasted blocks of open-position logic, along with comments stating that the push was integrated into the daily report. This led to four separate code paths, each containing the same false assumption that the push was handled during daily report generation.\n\nThe issue here was that the comments were merely claims about code that lived somewhere else. There was no enforcement mechanism to ensure that the push was indeed handled. When the \"elsewhere\" changed or when it never actually handled the case, the comments remained, confidently lying. The propagation of this lie across four code paths further exacerbated the problem.\n\nThe solution to this issue was straightforward: audit for call sites, not just definitions. To find dead code, it is essential to search for how a function is used, rather than just where it is defined. By enumerating the functions that should be firing but aren't, specifically the alert formatters and senders, the problem could be identified. Automating the search for call sites using a script helped to flag functions that only appear at their definition, revealing the dead code that had gone unnoticed for months.",
  "summary": "Your alert formatter is probably fine. The problem is that nobody calls it. The Symptom A user reports that instant push notifications stopped working. The daily report arrives on schedule. The formatting looks correct in the report. But the moment a position opens, nothing hits their phone. The first instinct is to blame the transport layer: the push service, the API key, the network. You check…",
  "key_points": [
    "formatinstantalert function built push messages, but never invoked",
    "Four code paths for opening positions each contained copy-pasted push logic",
    "Dead code persisted due to lack of enforcement mechanism"
  ],
  "editors_take": "Relying on unverified comments across multiple redundant code paths creates a false sense of security that allows silent, critical failures to persist undetected within a system for months.",
  "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."
}