Rename internal SSV symbols, URL and metric to RewardVerification#6667
Conversation
Generated by 🚫 Danger |
📸 Snapshot Test327 unchanged
🛸 Powered by Emerge Tools |
964388b to
3112c62
Compare
|
@RCGitBot please test |
Renames the internal AdMobSSV* types and SPI introduced in #6641 to RewardVerification* so the wording stays adapter-agnostic. Also renames the backend URL path and the client-side metric to match, so the SPI is provider-agnostic end to end. Renames: - Sources/Ads/AdMobSSV/ -> Sources/Ads/RewardVerification/ - AdMobSSVPollStatus -> RewardVerificationPollStatus - RewardVerificationPollStatus.validated -> .verified - AdMobSSVStatusResponse -> RewardVerificationStatusResponse - RewardVerificationStatusResponse.Status.validated -> .verified (the decoder still accepts the legacy "validated" wire value during the rollout window; covered by a new decoder unit test) - AdMobSSVStatusCallback -> RewardVerificationStatusCallback - GetAdMobSSVStatusOperation -> GetRewardVerificationStatusOperation - AdsAPI.getAdMobSSVStatus -> getRewardVerificationStatus - Purchases.pollAdMobSSVStatus -> pollRewardVerificationStatus - HTTPRequest.Path.adMobSSVStatus -> .rewardVerificationStatus - URL path: /ads/admob/ssv/{tx} -> /ads/reward_verifications/{tx} - Metric name: get_admob_ssv_status -> get_reward_verification_status - BackendErrorStrings.unknown_admob_ssv_status -> .unknown_reward_verification_status - Test files, test methods and snapshot artifacts renamed to match. - Xcode project file references updated in lockstep.
3112c62 to
a51bf20
Compare
|
@RCGitBot please test |
|
@RCGitBot please test |
The `RewardVerificationStatusResponse` decoder was accepting both `"verified"` and the legacy `"validated"` status from the backend as a backwards-compat hedge during rollout. The endpoint has not been shipped and the SDK has no public entry point that polls it yet, so there is no compatibility window to preserve — the decoder can require `"verified"` outright. While here, simplify the decoder to look up known cases via `Status(rawValue:)` instead of a string-literal switch, so adding a future case can't silently drift from the enum. Removes the corresponding `testDecodesLegacyValidatedWireValueAsVerified` test. Existing coverage for `verified`, `pending`, `failed`, and the `unknown` fallback (with the `Logger.warn` assertion) is unchanged.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 440962b. Configure here.
|
@RCGitBot please test |
ajpallares
left a comment
There was a problem hiding this comment.
Looks good! Only found a couple of nits
Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
Address review feedback: cover the case where the backend sends the literal "unknown" wire value, which still falls through the unmapped-status branch and should emit a warning.
|
@RCGitBot please test |
1 similar comment
|
@RCGitBot please test |

Checklist
purchases-androidand hybridsMotivation
The internal scaffolding from #6641 (the AdMob SSV poll endpoint) shipped under an
AdMobSSV*naming. As we extend the pipeline (PR 3 / #6663) and start exposing public API in PR 4, the adapter-agnostic spellingRewardVerificationreads better and decouples our internal type names from the AdMob brand. Renaming early — while this is still all internal/SPI — keeps the diff trivial and avoids carrying the old spelling forward.This is a pure rename. No behavior changes for the SDK; the only on-the-wire impact is the new request URL and metric name (see below).
Description
Renamed the internal
AdMobSSV*types and SPI introduced in #6641 toRewardVerification*, and renamed the matching backend URL path and client-side metric so the SPI is provider-agnostic end to end.Type / file renames
Sources/Ads/AdMobSSV/→Sources/Ads/RewardVerification/AdMobSSVPollStatus→RewardVerificationPollStatusAdMobSSVStatusResponse→RewardVerificationStatusResponseAdMobSSVStatusCallback→RewardVerificationStatusCallbackGetAdMobSSVStatusOperation→GetRewardVerificationStatusOperationAdsAPI.getAdMobSSVStatus(...)→getRewardVerificationStatus(...)Purchases.pollAdMobSSVStatus(...)→pollRewardVerificationStatus(...)(@_spi(Internal))HTTPRequest.Path.adMobSSVStatus→.rewardVerificationStatusBackendErrorStrings.unknown_admob_ssv_status→.unknown_reward_verification_statusStatus case rename (
validated→verified)RewardVerificationPollStatus.validated→.verifiedRewardVerificationStatusResponse.Status.validated→.verified"verified"wire value. The endpoint hasn't shipped yet and there's no public entry point in the SDK that polls it, so there is no compatibility window to preserve — no legacy"validated"mapping. Covered by a focused decoder test (RewardVerificationStatusResponseDecodingTests)..unknownis preserved for forward compatibility with future backend additions.Backend contract renames
/v1/subscribers/{app_user_id}/ads/admob/ssv/{client_transaction_id}→/v1/subscribers/{app_user_id}/ads/reward_verifications/{client_transaction_id}(collection plural, matches existing patterns likeworkflows/{workflowId},offerings,virtual_currencies).get_admob_ssv_status→get_reward_verification_status(singular, same convention asget_workflow— the metric describes "get the status of one record").Tests
BackendGetAdMobSSVStatusTests→BackendGetRewardVerificationStatusTests; method names and snapshot files updated. The test for the verified branch was renamed totestGetRewardVerificationStatusVerified.PurchasesAdMobSSVTests→PurchasesRewardVerificationTests; same.RewardVerificationStatusResponseDecodingTests— focused decoder tests coveringverified,pending,failed, and theunknownfallback (with aLogger.warnassertion to guard against silently dropping the diagnostic).…Validated.1.json→…Verified.1.json.Verification
swift buildpasses.UnitTests/BackendGetRewardVerificationStatusTestsUnitTests/PurchasesRewardVerificationTestsUnitTests/HTTPRequestTestsUnitTests/RewardVerificationStatusResponseDecodingTestsswiftlintpasses on all changed files.Why a separate PR
The follow-up PR #6663 (PR 3 — adapter-side reward verification pipeline) layers a larger structural change on top. Landing this rename first keeps that PR's diff focused on actual logic instead of mechanical renames.
Note
Medium Risk
Although largely mechanical renames, this changes the on-the-wire URL and expected success status string, which could break any internal adapters or backend integrations not updated in lockstep.
Overview
This PR renames the internal AdMob SSV reward-verification polling surface to provider-agnostic
RewardVerificationacross the SDK (AdsAPI.getRewardVerificationStatus,Purchases.pollRewardVerificationStatus, newRewardVerification*types/files), and updates the Xcode project to reflect the moved/renamed sources.It also changes the backend contract by renaming the request path from
/ads/admob/ssv/...to/ads/reward_verifications/..., updates the metric/endpoint name, and renames the terminal success status fromvalidatedtoverified(with updated decoding/logging and refreshed unit tests/snapshots, plus a new decoding test).Reviewed by Cursor Bugbot for commit b4f80cf. Bugbot is set up for automated code reviews on this repo. Configure here.