Repository navigation
fix(apple-ads): Route Platform API through provider pipeline - #92
Merged
Merged
Conversation
Platform API calls used the client's default transport, so they had no pacing, 429 backoff, or refresh metrics. The classifier still matched the retired api.searchads.apple.com host, leaving the Apple Ads API policy unreachable. Send requests through the provider HTTP pipeline, classify api.ads.apple.com, retry the read-only query POSTs, and report cancellation as cancellation. Remove the unused AppleSearchAdsJWT and lead the README setup with the Platform API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The competitor lookback read the system clock instead of the service's injected now. Test fixtures dated May 2026 fell outside the 180-day window around October 28, which broke four tests on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Apple Ads Platform API calls used the Swift client's default transport, which skips
ProviderRequestGateandObservedHTTPClient. They had no pacing, no 429 backoff, and no refresh metrics, and the client only retries on 401. Apple's rate limit docs say to honorRetry-After. The classifier also still matched the retiredapi.searchads.apple.comhost, so the.appleAdsAPIpolicy could never apply.AppleAdsHTTPClientTransport, which sends generated client requests through the app'sHTTPClientpipeline, and use it in the app and MCP runtimes.api.ads.apple.comas.appleAdsAPI.retryOnly, not deduplicated.performinstead of reporting it as a provider failure, since requests can now wait in the gate.AppleSearchAdsJWT.main.research/directory, which held two October 26 review notes that nothing references.Behavior change: Platform API requests are now paced to at least one second apart, using the existing
.appleAdsAPIpolicy. Large popularity refreshes and MCP keyword discovery may take a little longer.Out of scope: OAuth token requests still use the client's own HTTP client, so they stay outside the pipeline. No release is included.
This does not affect the January 26, 2027 Campaign Management API sunset. OpenASO stopped calling that API in v0.4.3.
Validation
api.ads.apple.com.git diff --check origin/main...HEAD: clean.Command:
xcodebuild test -project OpenASO.xcodeproj -scheme OpenASO -destination 'platform=macOS,arch=arm64' -derivedDataPath Build CODE_SIGNING_ALLOWED=NOBefore the clock fix, four
OpenASOMCPServiceTestsfailed locally, in CI on this PR, and locally on an untouchedmainat1fc391e. Competitor lookback read the system clock, so fixtures dated May 2026 fell outside its 180-day window around October 28. The cutoff now uses the service's injectednow. Production behavior does not change, becausenowdefaults to the current date.Please try one real Platform API refresh before the next release, because the transport moved from AsyncHTTPClient to URLSession.
Review State
Source and Credit
Independent implementation. It follows the audit of Apple Ads API references against the Campaign Management sunset.
🤖 Generated with Claude Code