fix: edit_listing silent write loss β publish + verify after update - #12
Open
asklepios-png wants to merge 2 commits into
Open
fix: edit_listing silent write loss β publish + verify after update#12asklepios-png wants to merge 2 commits into
asklepios-png wants to merge 2 commits into
Conversation
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>
# Conflicts: # README.md
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.
Problem
edit_listing(MCP),torium listings edit(CLI), andListingsAPI.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:
PUT /adinput/ad/recommerce/{id}/updateonly stores a draft revision (this is why a new ETag is returned β the revision is real).GET productcontext?adRevision=XβPOST /adinput/order/choices/{id}β the same completion sequencecreate()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/choicesis the working commit path. Note that adview propagation after the commit takes minutes, not seconds.Fix
ListingsAPI.edit(ad_id, price=β¦, title=β¦, description=β¦): update β publish (Basic, free) β read-back verification against adview (staggered ~5.5 min window). RaisesRuntimeErrorinstead of ever reporting an unverified success.update()now raises onmeta-datavalidation violations (the API returns them with HTTP 200).edit_listingand CLIlistings editrouted throughedit();set_price()too.CONTEXT.mddocuments the root cause, live findings, and API behaviors (e.g.editedtimestamp 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