Skip to content

doordash.com: fix remove_cart_item on live carts (null store ids, first-line removal) - #139

Merged
yummybomb merged 2 commits into
mainfrom
hypeship/doordash-remove-cart-null-store
Oct 28, 2026
Merged

yummybomb merged 2 commits into
mainfrom
hypeship/doordash-remove-cart-null-store

Conversation

@yummybomb

@yummybomb yummybomb commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two fixes that made remove_cart_item fail on real DoorDash carts.

Null line store ids. DoorDash's listDetailedCarts returns orderItems[].item.storeId as null, and the per-line check compared String(null) with expected_store_id. Every cart therefore failed as "conflicting" before the line and revision checks ran, so the tool returned blocked even for unknown lines and stale revisions. A line with a null store id is now accepted. A store id that is present and different is still refused. The cart's restaurant.id, checked earlier, stays the store check.

First-line removal. DoorDash ids the cart's order after its first line. Removing that line renames the order to the next remaining line, so the postcondition saw a changed order id and returned outcome_unknown even though the removal succeeded (the guard then blocked the cart). The postcondition now accepts an order id change only when the order was named after the removed line and the new id is one of the remaining lines; any other order id change is still unconfirmed.

Tests

  • The shared cart fixture now sends storeId: null, as the live site does. With the old source, 14 removal tests fail on it; with this change they pass. The "conflicting store" refusal test (storeId: "1002") still passes.
  • New tests: removing the line the order is named after confirms the removal; an order renamed to a non-remaining id, or renamed when it wasn't named after the removed line, stays outcome_unknown. Each fails against the matching mutant (no rename handling / accept any rename).
  • node --test "tests/*.test.mjs": 4485 pass. node scripts/validate-registry.mjs: valid.

Live check (not independent QA)

On a signed-in cart with three lines, using this source:

  • removing the first of three, then the second of two, each returned removed with the other lines kept, and the returned revision matched a fresh get_cart
  • stale revision and wrong store returned stale_state, unknown cart and line not_found, wrong account wrong_account, invalid input invalid_input, a pre-aborted signal cancelled, and the last line was refused, all without a write
  • the previous source returned blocked for a valid removal and outcome_unknown for a successful first-line removal

The cart was emptied afterwards. The status stays draft until independent QA.

@yummybomb yummybomb changed the title doordash.com: accept null line store ids in remove_cart_item doordash.com: fix remove_cart_item on live carts (null store ids, first-line removal) Oct 28, 2026
@yummybomb
yummybomb marked this pull request as ready for review October 28, 2026 14:34
@yummybomb
yummybomb merged commit e887e68 into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant