Skip to content

Expand DangerousSettings API tester coverage#6810

Merged
ajpallares merged 1 commit into
mainfrom
pallares/dangerous-settings-api-test-coverage
May 20, 2026
Merged

Expand DangerousSettings API tester coverage#6810
ajpallares merged 1 commit into
mainfrom
pallares/dangerous-settings-api-test-coverage

Conversation

@ajpallares

@ajpallares ajpallares commented May 17, 2026

Copy link
Copy Markdown
Member

Checklist

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

Motivation

Establish a safety net for the public surface of DangerousSettings before #6811, which backs it (and Configuration, PlatformInfo) with internal Hashable value-type storage. Lands first, on its own, so we can prove the tests pass against today's main rather than only after the refactor.

Description

  • Swift API tester: exercise DangerousSettings(), DangerousSettings(autoSyncPurchases:), and read all three public properties.
  • Obj-C API tester: new RCDangerousSettingsAPI.{h,m} mirroring the RCConfigurationAPI pattern, wired into main.m and the AllAPITests.xcodeproj. Covers -init, -initWithAutoSyncPurchases:, and reads of the two Obj-C-bridged properties (uiPreviewMode is @_spi(Internal) and not bridged).

Verified by building All API Tests against this branch:

xcodebuild -workspace RevenueCat-Tuist.xcworkspace -scheme "All API Tests" -destination "generic/platform=iOS Simulator" -configuration release build

Made with Cursor


Note

Low Risk
Low risk: changes are confined to API surface compile-time testers and Xcode project wiring, with no production runtime behavior modified.

Overview
Adds broader API-surface coverage for DangerousSettings in the API tester suite.

Updates the Swift tester to exercise additional initializers and property reads, and introduces a new Objective-C tester (RCDangerousSettingsAPI) that instantiates RCDangerousSettings and verifies bridged properties; the Obj-C tester is wired into main.m and the AllAPITests.xcodeproj sources.

Reviewed by Cursor Bugbot for commit 3766319. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds explicit property-read and constructor coverage for `DangerousSettings`
in both the Swift and Obj-C API testers so future refactors of the type
(e.g. moving stored properties into an internal value-type backing) are
guaranteed to remain source- and ABI-compatible for SDK consumers.

Swift (SwiftAPITester/DangerousSettingsAPI.swift):
- Exercise `DangerousSettings()` and `DangerousSettings(autoSyncPurchases:)`
  in addition to the existing `DangerousSettings(uiPreviewMode:)` case.
- Read all three publicly exposed properties (`autoSyncPurchases`,
  `customEntitlementComputation`, `uiPreviewMode`).

Obj-C (ObjcAPITester/RCDangerousSettingsAPI.{h,m}):
- New file mirroring the `RCConfigurationAPI` pattern (one
  `+ (void)checkAPI` per public type), wired into `main.m` and the
  `AllAPITests.xcodeproj` project file.
- Covers `-init`, `-initWithAutoSyncPurchases:`, and reads of the two
  Obj-C-exposed properties (`autoSyncPurchases`, `customEntitlementComputation`).
  `uiPreviewMode` is intentionally omitted since it is `@_spi(Internal)` and
  not bridged to Obj-C.

These additions are landed first so we can verify the existing public
surface compiles on `main`, before any refactor of `DangerousSettings`
internals is layered on top.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares ajpallares changed the title Expand API tester coverage Expand DangerousSettings API tester coverage May 17, 2026
@ajpallares ajpallares marked this pull request as ready for review May 17, 2026 20:22
@ajpallares ajpallares requested a review from a team as a code owner May 17, 2026 20:22

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚢

@ajpallares ajpallares merged commit c5a7523 into main May 20, 2026
18 of 20 checks passed
@ajpallares ajpallares deleted the pallares/dangerous-settings-api-test-coverage branch May 20, 2026 18:38
This was referenced May 22, 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.

2 participants