Repository navigation
doordash.com: fix remove_cart_item on live carts (null store ids, first-line removal) - #139
Merged
Merged
Conversation
yummybomb
marked this pull request as ready for review
October 28, 2026 14:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes that made
remove_cart_itemfail on real DoorDash carts.Null line store ids. DoorDash's
listDetailedCartsreturnsorderItems[].item.storeIdasnull, and the per-line check comparedString(null)withexpected_store_id. Every cart therefore failed as "conflicting" before the line and revision checks ran, so the tool returnedblockedeven 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'srestaurant.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_unknowneven 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
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.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:
removedwith the other lines kept, and the returned revision matched a freshget_cartstale_state, unknown cart and linenot_found, wrong accountwrong_account, invalid inputinvalid_input, a pre-aborted signalcancelled, and the last line was refused, all without a writeblockedfor a valid removal andoutcome_unknownfor a successful first-line removalThe cart was emptied afterwards. The status stays
draftuntil independent QA.