Hydra
Bug library · state · state

Stale cart state

Remove mutates the cart array in place, so React never re-renders and the removed item lingers.

Breaks: main · expected from Kane: caught · The main spec verifies the cart right after Remove, before any re-render masks it.

The diff

components/Checkout.tsx
- setLines((current) => current.filter((l) => l.sku !== sku));
+ setLines((current) => {
+ const index = current.findIndex((l) => l.sku === sku);
+ if (index >= 0) current.splice(index, 1);
+ return current;
+ });