{
  "id": 3085030,
  "title": "Your retry logic is correct and does nothing",
  "url": "https://urgent.news/2026/08/24/your-retry-logic-is-correct-and-does-nothing",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-24T18:12:14.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/siddharth_pandey_27/your-retry-logic-is-correct-and-does-nothing-9oc"
  },
  "original_language": "en",
  "account": "The issue at hand concerns a Lambda function designed to process a batch of messages in Amazon SQS. Initially, the function appeared correct, as it correctly identified the failure of a single message within the batch, listing it in `batchItemFailures`. However, a deeper analysis revealed that the function's behavior was dependent on an external setting. This setting controlled whether the function's partial batch response was actually reported or discarded by Lambda. If the setting was not explicitly set to `ReportBatchItemFailures`, the handler's output was ignored, leading to the entire batch being requeued, including the already processed messages. This resulted in duplicate processing, causing unnecessary work and potential financial losses due to double-charging customers. The problem stemmed from a mismatch between the Lambda handler's code and the configuration of the event source mapping. The handler was designed correctly in terms of error handling and partial batch response logic, but the mapping for the trigger did not indicate that this behavior should be reported. This discrepancy led to the handler being perceived as correct by code reviewers, despite its failure to function as intended. The solution lies in ensuring that the Lambda function and the event source mapping are aligned. The event source mapping must be configured to include `ReportBatchItemFailures` if the handler should report the partial batch response. This alignment ensures that the Lambda function behaves as expected, with only the failed item reported and the rest of the batch being deleted from the queue.",
  "summary": "A comment on one of my posts sat open as an issue for two weeks before I understood how bad the thing it described actually was. The post was about an AI assistant missing the SQS trigger on a Lambda. Mads Hansen replied with a sentence I have not been able to unthink since: the trigger shape is the first contract, delivery and retry semantics are the second. Getting event.Records[0].body right…",
  "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."
}