Report the item a cart action actually acted on
Validate / hassfest (push) Failing after 6s
Validate / HACS (push) Failing after 16s
Validate / pytest (push) Failing after 7s

_cart_action scraped the first .item-name off the item page, which belongs to
whatever is in the mini-cart rather than the item being added — so an add
announced someone else's groceries in its event payload. Callers pass the name
they resolved instead; verified by an add/remove round trip against a live
order.
This commit is contained in:
flan
2026-08-03 20:23:49 +00:00
parent 5e9d721a0f
commit 0a218acd45
2 changed files with 13 additions and 9 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ class FreshHarvestBox(FreshHarvestEntity, TodoListEntity):
item_id, name = await self._algolia_lookup(query)
try:
result = await self.coordinator.actions.async_add_item(
item_id, dry_run=False
item_id, dry_run=False, name=name
)
except FreshHarvestError as err:
self._fire(EVENT_ACTION, "add_item", False, query, str(err))
@@ -166,7 +166,7 @@ class FreshHarvestBox(FreshHarvestEntity, TodoListEntity):
item_id, name = await self._algolia_lookup(uid)
try:
await self.coordinator.actions.async_remove_item(
item_id, dry_run=False
item_id, dry_run=False, name=name
)
except FreshHarvestError as err:
self._fire(EVENT_ACTION, "remove_item", False, uid, str(err))