Skip to content

fix: edit_listing silent write loss β€” publish + verify after update - #12

Open
asklepios-png wants to merge 2 commits into
ahnl:mainfrom
asklepios-png:fix/edit-listing-publish
Open

fix: edit_listing silent write loss β€” publish + verify after update#12
asklepios-png wants to merge 2 commits into
ahnl:mainfrom
asklepios-png:fix/edit-listing-publish

Conversation

@asklepios-png

Copy link
Copy Markdown
Contributor

Problem

edit_listing (MCP), torium listings edit (CLI), and ListingsAPI.set_price() reported success but the live listing never changed β€” silent write loss. The tool returned a fresh ETag, so the failure was invisible; in our case 64 edits were "made" that never existed.

Root cause

The adinput API is two-phase, like a draft email that is never sent:

  1. PUT /adinput/ad/recommerce/{id}/update only stores a draft revision (this is why a new ETag is returned β€” the revision is real).
  2. The live ad only changes after the commit step: GET productcontext?adRevision=X β†’ POST /adinput/order/choices/{id} β€” the same completion sequence create() already uses.

The edit flow stopped after step 1 and inferred success from the ETag alone.

Verified live: a pending draft revision from a failed edit sat unpublished for 2 days; running the commit step published it. Also confirmed: the checkout-url (publish_free_ad?adRevision=...) returns 404 on POST β€” order/choices is the working commit path. Note that adview propagation after the commit takes minutes, not seconds.

Fix

  • New ListingsAPI.edit(ad_id, price=…, title=…, description=…): update β†’ publish (Basic, free) β†’ read-back verification against adview (staggered ~5.5 min window). Raises RuntimeError instead of ever reporting an unverified success.
  • update() now raises on meta-data validation violations (the API returns them with HTTP 200).
  • MCP edit_listing and CLI listings edit routed through edit(); set_price() too.
  • Editing an EXPIRED listing republishes it in the same call (same commit endpoint).
  • CLI checkmark output made cp1252-safe (crashed on legacy Windows consoles).
  • Regression tests (mocked client, no network): publish ordering, read-back mismatch, violation handling, whitespace normalization. Red-green verified against the old code.
  • CONTEXT.md documents the root cause, live findings, and API behaviors (e.g. edited timestamp reflects revision creation time, not publish time).

Verified against a real account: a price change and 63 pending description revisions all published and read-back-verified.

πŸ€– Generated with Claude Code

asklepios-png and others added 2 commits July 13, 2026 12:23
The adinput API is two-phase: PUT .../update only stores a draft
revision; the live ad changes only after the commit step (productcontext
+ POST /order/choices β€” the same sequence create() uses). edit_listing
stopped after the PUT and inferred success from the returned ETag, so
edits were never published while the tool reported success.

- ListingsAPI.edit(): update β†’ publish (Basic) β†’ read-back verification
  against adview (staggered ~5.5 min window; propagation takes minutes).
  Raises instead of ever reporting an unverified success.
- update() now raises on meta-data validation violations (the API
  returns them with HTTP 200).
- MCP edit_listing and CLI listings edit routed through edit();
  set_price() too. CLI checkmark output made cp1252-safe.
- Regression tests (mocked client): publish ordering, read-back
  mismatch, violation handling. Red-green verified.
- CONTEXT.md added: root cause, live findings (order/choices is the
  commit; publish_free_ad POSTs 404; edited timestamp = revision time).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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