{"record":{"id":"2d0aa3326318365d","repo":"home-assistant/core","slug":"todo-delete-item-failed","errorCode":null,"errorMessage":"todo_delete_item_failed","messagePattern":"todo_delete_item_failed","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/bring/todo.py","lineNumber":234,"sourceCode":"    @override\n    async def async_delete_todo_items(self, uids: list[str]) -> None:\n        \"\"\"Delete an item from the To-do list.\"\"\"\n\n        try:\n            await self.coordinator.bring.batch_update_list(\n                self._list_uuid,\n                [\n                    BringItem(\n                        itemId=uid,\n                        spec=\"\",\n                        uuid=uid,\n                    )\n                    for uid in uids\n                ],\n                BringItemOperation.REMOVE,\n            )\n        except BringRequestException as e:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"todo_delete_item_failed\",\n                translation_placeholders={\"count\": str(len(uids))},\n            ) from e\n\n        await self.coordinator.async_refresh()\n\n    async def async_send_message(\n        self,\n        message: BringNotificationType,\n        item: str | None = None,\n    ) -> None:\n        \"\"\"Send a push notification to members of a shared bring list.\"\"\"\n\n        try:\n            await self.coordinator.bring.notify(self._list_uuid, message, item or None)\n        except BringRequestException as e:\n            raise HomeAssistantError(","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bring/todo.py#L216-L252","documentation":"Raised by async_delete_todo_items when the batch_update_list REMOVE operation for the selected uids fails with BringRequestException. It reports the count of items that failed to remove. Each uid is sent as both itemId and uuid with operation REMOVE.","triggerScenarios":"Deleting one or many To-do items while the Bring batch endpoint fails: stale uids (items already removed elsewhere), session expiry, network timeout.","commonSituations":"Bulk-clearing a list that was simultaneously cleared on a phone, expired auth, Bring cloud instability, deleting items whose uuid mapping changed after list re-creation.","solutions":["Refresh the list and retry deletion with the current item selection.","Reload the Bring integration to resynchronize item uids with Bring state.","Re-authenticate if all writes fail.","Reduce concurrency: avoid deleting from two clients at the same time."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"def filter_stale_uids(coordinator, list_uuid, uids: list[str]) -> list[str]:\n    \"\"\"Keep only uids still present in Bring state to avoid batch rejection.\"\"\"\n    live = {i.get(\"uuid\") for i in coordinator.data.get(list_uuid, {}).get(\"items\", [])}\n    return [u for u in uids if u in live]","typeGuard":null,"tryCatchPattern":"try:\n    await todo_entity.async_delete_todo_items(uids)\nexcept HomeAssistantError as err:\n    if err.translation_key == \"todo_delete_item_failed\":\n        await coordinator.async_refresh()\n        await todo_entity.async_delete_todo_items(uids)  # retry with resynced ids\n    else:\n        raise","preventionTips":["Do not clear the same list from the phone app and HA at the same time.","Filter deletion lists against current coordinator data to drop already-removed uids.","Batch deletes in moderate sizes so partial failures are easy to re-drive."],"tags":["home-assistant","bring","todo","network"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}