Repository navigation
fix(examples): wire assertMediaBuyTransition into hello_seller_adapter_non_guaranteed (#1499) - #1513
Merged
Conversation
…r_non_guaranteed (closes #1499) The non-guaranteed worked-reference adapter had no state-machine enforcement on update_media_buy; the cascade scenario media_buy_seller/invalid_transitions/second_cancel failed because the adapter accepted re-cancel instead of rejecting with NOT_CANCELLABLE. SDK-side helpers shipped in 6.7 (MEDIA_BUY_TRANSITIONS + assertMediaBuyTransition) but the example didn't wire them. Adds a per-buy localBuyStatus Map for paused/canceled states (the mock upstream doesn't model these) and calls assertMediaBuyTransition on every cancel/pause path. Matches the pattern already in hello_seller_adapter_guaranteed. Drops the adcp-client#1416 mask from the gate test; the storyboard now passes unfiltered. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bokelley
added a commit
that referenced
this pull request
May 3, 2026
Pulls in 4 commits: - docs(skills): close three #1496 follow-up review items + seller adapter format slot sweep (#1515) - docs(migration): add recipe #10b for derived-mode account_id refusal (#1492) (#1512) - fix(codegen): preserve asset_type discriminator on Individual*Asset slot types (closes #1498) (#1514) - fix(examples): wire assertMediaBuyTransition into hello_seller_adapter_non_guaranteed (closes #1499) (#1513) Conflict resolution: - src/lib/types/core.generated.ts: kept the 3.0.6 generation header from HEAD; ran `npm run generate-types:all` against the local mirror to pull in main's #1514 codegen fix (asset_type discriminator preserved on Individual*Asset slots) layered on top of 3.0.6 schemas. - test/examples/hello-seller-adapter-non-guaranteed.test.js: kept main's empty allowlist + new helper-shape conditional. Main's #1513 closes #1416 by actually wiring `assertMediaBuyTransition` into the non-guaranteed adapter — superseding the follow-up note my branch carried. Verified post-merge: - npm run build clean - 6/6 hello-adapter tests for the modified files green - npm run format:check clean Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Closes #1499.
Why
The non-guaranteed worked-reference adapter had no state-machine enforcement on
update_media_buy. The cascademedia_buy_seller/invalid_transitions/second_cancelfailed because the adapter accepted a re-cancel instead of rejecting withNOT_CANCELLABLE. SDK-side helpers shipped in 6.7 (MEDIA_BUY_TRANSITIONS+assertMediaBuyTransition, closing #1416) but this example didn't wire them.What
assertMediaBuyTransitionandAdcpMediaBuyStatusfrom@adcp/sdk/serverlocalBuyStatusMap forpaused | canceled(mock upstream doesn't model these)updateMediaBuy, callassertMediaBuyTransition(currentStatus, 'canceled')on cancel andassertMediaBuyTransition(currentStatus, 'paused')on pause-of-active. Matches the guaranteed adapter's patternadcp-client#1416mask from the gate test; storyboard now passes unfilteredTest plan
npm run format:check— cleannpm run typecheck— cleannpm run build:lib— cleannode --test test/examples/hello-seller-adapter-non-guaranteed.test.js— 3/3 pass with EXPECTED_FAILURES = []🤖 Generated with Claude Code