{
  "id": 8788170,
  "title": "Four bugs my test suite couldn't catch",
  "url": "https://urgent.news/2026/09/20/four-bugs-my-test-suite-couldnt-catch",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-20T22:49:47.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/lucifer911/four-bugs-my-test-suite-couldnt-catch-2ip0"
  },
  "original_language": "en",
  "account": "The source material describes several bugs discovered in a test suite for an encrypted messenger application. The first bug is a race condition caused by asynchronous loading of decryption keys from browser storage, which resulted in decrypted messages being dropped. The solution was to restore the state before connecting to the server.\n\nThe second bug involved acknowledging the wrong event, leading to the deletion of data that had not been fully processed. The fix was to confirm message handling only after it had been completed successfully.\n\nThe third bug was a cleanup path that never ran, causing messages to accumulate on the server side when both users were online. A solution was to store messages only when no recipients were available to receive them.\n\nThe fourth bug occurred when removing a chat, which deleted messages but left encryption keys behind. If the same person was re-added, the app would attempt to resume a conversation that had been discarded by the other side. The fix was to delete everything derived from a deleted thing, preventing orphaned state from causing issues.\n\nThe author concludes that the key to finding these bugs was running the test suite against the deployed build, simulating real-world usage. This approach uncovered four critical bugs, two of which resulted in user data loss. The author emphasizes that tests are essential for ensuring individual components function correctly, but they are inadequate for testing the entire system. The author's approach involved testing against the actual deployed software, which led to the discovery of these bugs and improved the overall reliability of the messenger application.",
  "summary": "216 passing tests. A feature that was completely broken. Here is the gap between those two facts, and what I changed afterwards. The feature I am building an encrypted messenger. Messages are end to end encrypted, and the server relaying them cannot read anything. That part worked. What I added was offline delivery. If you message someone whose app is closed, the server should hold the message,…",
  "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."
}