Skip to content

Rename internal SSV symbols, URL and metric to RewardVerification#6667

Merged
polmiro merged 6 commits into
mainfrom
rewardverification-rename-merged
Apr 23, 2026
Merged

Rename internal SSV symbols, URL and metric to RewardVerification#6667
polmiro merged 6 commits into
mainfrom
rewardverification-rename-merged

Conversation

@polmiro

@polmiro polmiro commented Apr 22, 2026

Copy link
Copy Markdown
Member

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

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 spelling RewardVerification reads 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 to RewardVerification*, and renamed the matching backend URL path and client-side metric so the SPI is provider-agnostic end to end.

Type / file renames

  • Source layout: Sources/Ads/AdMobSSV/Sources/Ads/RewardVerification/
  • Types:
    • AdMobSSVPollStatusRewardVerificationPollStatus
    • AdMobSSVStatusResponseRewardVerificationStatusResponse
    • AdMobSSVStatusCallbackRewardVerificationStatusCallback
    • GetAdMobSSVStatusOperationGetRewardVerificationStatusOperation
  • Methods:
    • AdsAPI.getAdMobSSVStatus(...)getRewardVerificationStatus(...)
    • Purchases.pollAdMobSSVStatus(...)pollRewardVerificationStatus(...) (@_spi(Internal))
  • Enum cases / log strings:
    • HTTPRequest.Path.adMobSSVStatus.rewardVerificationStatus
    • BackendErrorStrings.unknown_admob_ssv_status.unknown_reward_verification_status

Status case rename (validatedverified)

  • RewardVerificationPollStatus.validated.verified
  • RewardVerificationStatusResponse.Status.validated.verified
  • The decoder accepts only the new "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).
  • .unknown is preserved for forward compatibility with future backend additions.

Backend contract renames

  • URL path: /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 like workflows/{workflowId}, offerings, virtual_currencies).
  • Metric name: get_admob_ssv_statusget_reward_verification_status (singular, same convention as get_workflow — the metric describes "get the status of one record").

Tests

  • BackendGetAdMobSSVStatusTestsBackendGetRewardVerificationStatusTests; method names and snapshot files updated. The test for the verified branch was renamed to testGetRewardVerificationStatusVerified.
  • PurchasesAdMobSSVTestsPurchasesRewardVerificationTests; same.
  • New file: RewardVerificationStatusResponseDecodingTests — focused decoder tests covering verified, pending, failed, and the unknown fallback (with a Logger.warn assertion to guard against silently dropping the diagnostic).
  • 108 snapshot fixtures updated to reflect the new URL; 9 fixtures renamed …Validated.1.json…Verified.1.json.
  • Xcode project file references updated in lockstep.

Verification

  • swift build passes.
  • Targeted xcodebuild run of the renamed/added tests passes:
    • UnitTests/BackendGetRewardVerificationStatusTests
    • UnitTests/PurchasesRewardVerificationTests
    • UnitTests/HTTPRequestTests
    • UnitTests/RewardVerificationStatusResponseDecodingTests
  • swiftlint passes 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 RewardVerification across the SDK (AdsAPI.getRewardVerificationStatus, Purchases.pollRewardVerificationStatus, new RewardVerification* 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 from validated to verified (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.

@RevenueCat-Danger-Bot

RevenueCat-Danger-Bot commented Apr 22, 2026

Copy link
Copy Markdown
1 Warning
⚠️ RevenueCat.xcodeproj is out of sync.

The following Swift files were added but are missing from RevenueCat.xcodeproj:
Tests/UnitTests/Purchasing/Purchases/PurchasesRewardVerificationTests.swift

To fix: open RevenueCat.xcodeproj in Xcode, add/remove the files above in the appropriate target. Check where similar files in the same directory are assigned if you're unsure which target to use.

Generated by 🚫 Danger

@emerge-tools

emerge-tools Bot commented Apr 22, 2026

Copy link
Copy Markdown

📸 Snapshot Test

327 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
RevenueCat
com.revenuecat.PaywallsTester
0 0 0 0 264 0 N/A
PaywallsTester V1 swift-snapshot-testing
com.revenuecat.PaywallsTester.v1-snapshots
0 0 0 0 63 0 N/A

🛸 Powered by Emerge Tools

@polmiro polmiro force-pushed the rewardverification-rename-merged branch 2 times, most recently from 964388b to 3112c62 Compare April 22, 2026 17:42
@polmiro polmiro requested a review from ajpallares April 22, 2026 18:09
@polmiro

polmiro commented Apr 22, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@polmiro polmiro marked this pull request as ready for review April 22, 2026 18:09
@polmiro polmiro requested a review from a team as a code owner April 22, 2026 18:09
@polmiro polmiro changed the title Rename internal AdMobSSV symbols to RewardVerification Rename internal AdMobSSV symbols, URL and metric to RewardVerification Apr 22, 2026
@polmiro polmiro requested a review from peterporfy April 22, 2026 18:11
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.
@polmiro polmiro force-pushed the rewardverification-rename-merged branch from 3112c62 to a51bf20 Compare April 23, 2026 07:07
@polmiro polmiro changed the title Rename internal AdMobSSV symbols, URL and metric to RewardVerification Rename internal SSV symbols, URL and metric to RewardVerification Apr 23, 2026
@polmiro

polmiro commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@polmiro

polmiro commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

@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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

@polmiro

polmiro commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@ajpallares ajpallares left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Only found a couple of nits

Comment thread Sources/Purchasing/Purchases/Purchases.swift Outdated
polmiro and others added 3 commits April 23, 2026 12:52
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.
@polmiro

polmiro commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

1 similar comment
@polmiro

polmiro commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@polmiro polmiro merged commit 7d7d584 into main Apr 23, 2026
41 checks passed
@polmiro polmiro deleted the rewardverification-rename-merged branch April 23, 2026 11:57
This was referenced Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants