Conversation
…pe in GPP Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: codeant-ai[bot] <151821869+codeant-ai[bot]@users.noreply.github.com>
…rTCF protocol signature Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add gppSignalingEnabled/gpcSignalHonoured to UsercentricsSettings mock, metadata to UsercentricsService/ServiceConsentTemplate mocks, and mspaCoveredTransaction/mspaMode to CCPASettings mock. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- DisposableEvent.callback removed; use init(callback:) instead - TCF2Settings.resurfacePeriodEnded renamed to resurfacePeriod (Int32) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- TCF2Settings: resurfacePeriodEnded (bool) renamed to resurfacePeriod (int) - CCPASettings: add mspaCoveredTransaction, mspaMode - UsercentricsSettings: add gppSignalingEnabled, gpcSignalHonoured - Update iOS/Android serializers and TypeScript models Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uctor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nullable type UsercentricsDisposableEvent.init(callback:) now expects ((T?) -> Void)? in 2.26.1. Wrap the non-optional callback to handle the optional payload parameter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
📝 WalkthroughWalkthroughVersion 2.26.1 release introduces GPP (Global Privacy Platform) support with new DPS metadata APIs and configurable TCF resurfacing periods. Updates version numbers across build configuration and package files. Extends data models with GPP signaling, MSPA, and resurfacing period fields. Updates native bridge serialization and denyAllForTCF API with unsaved vendor LI decisions parameter. Aligns test mocks across platforms. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review Summary by QodoRelease 2.26.1: Add GPP support and expose new SDK fields
WalkthroughsDescription• Upgrade Usercentrics SDK to version 2.26.1 with new GPP framework support • Expose new SDK fields: resurfacePeriod, gppSignalingEnabled, gpcSignalHonoured, mspaMode, mspaCoveredTransaction • Fix Android nullable type mismatch in setGPPConsent and iOS closure return types • Update mocks and tests for SDK 2.26.1 API changes including DisposableEvent and denyAllForTCF signature Diagramflowchart LR
A["SDK 2.26.1 Upgrade"] --> B["New Fields Exposed"]
A --> C["Bug Fixes"]
B --> D["TCF2Settings: resurfacePeriod"]
B --> E["UsercentricsSettings: gppSignalingEnabled, gpcSignalHonoured"]
B --> F["CCPASettings: mspaMode, mspaCoveredTransaction"]
C --> G["Android: Nullable type handling"]
C --> H["iOS: Closure return types"]
C --> I["Mock updates for API changes"]
File Changes1. android/build.gradle.kts
|
Code Review by Qodo
|
|
PR Summary: Release 2.26.1: adds US National (GPP) support, exposes DPS metadata, makes TCF resurface period configurable, and updates cross-platform bridges/serializers and tests. Version bumps and multiple compatibility fixes included.
|
android/src/main/java/com/usercentrics/reactnative/extensions/UsercentricsCMPDataExtensions.kt
Show resolved
Hide resolved
android/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.kt
Show resolved
Hide resolved
|
Reviewed up to commit:33fd8718a678483dc4bc4b6fc79a41df054bc45e Additional Suggestionandroid/src/main/java/com/usercentrics/reactnative/extensions/UsercentricsCMPDataExtensions.kt, line:283-287getMspaModeCompat (lines ~283-287) obtains an enum instance via reflection and then calls ordinal via reflection and casts to Int. Use Number conversion instead of as? Int to be robust across JVM boxing: val ordinal = (mode.javaClass.getMethod("ordinal").invoke(mode) as? Number)?.toInt(). Also consider returning a concrete default (e.g. null vs -1) and document the semantics.private fun CCPASettings.getMspaModeCompat(): Int? {
return runCatching {
val mode = javaClass.getMethod("getMspaMode").invoke(this) ?: return@runCatching null
(mode.javaClass.getMethod("ordinal").invoke(mode) as? Number)?.toInt()
}.getOrNull()
} |
android/src/main/java/com/usercentrics/reactnative/extensions/UsercentricsCMPDataExtensions.kt
Show resolved
Hide resolved
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
sample/ios/sampleTests/Fake/FakeUsercentricsManager.swift (1)
111-116: Keep the stored callback in sync with the subscription lifecycle.
gppSectionChangeCallbackis retained independently of the returned subscription, so test code can still trigger the old observer after cleanup. Please clear or gate the stored callback when the subscription is disposed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sample/ios/sampleTests/Fake/FakeUsercentricsManager.swift` around lines 111 - 116, The stored gppSectionChangeCallback in FakeUsercentricsManager is kept alive independently of the returned subscription; update onGppSectionChange to clear or gate that stored callback when the subscription is disposed by returning a UsercentricsDisposableEvent whose dispose/teardown closure sets gppSectionChangeCallback = nil (and still forwards payloads while subscribed), ensuring gppSectionChangeCallback is assigned on subscribe and cleared on disposal so old observers cannot be invoked after cleanup.sample/ios/sampleTests/Mock/CMPData+Mock.swift (1)
281-283: Add one non-nilMSPA mode fixture.
mspaModestaysnilin the updated mock, so the new ordinal serialization branch is still untested. Please include at least one mock/assertion with a concrete mode value.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sample/ios/sampleTests/Mock/CMPData`+Mock.swift around lines 281 - 283, The mock constructor in CMPData+Mock.swift currently sets mspaMode: nil so the ordinal-serialization branch remains untested; update the mock(s) that build CMPData (the factory in CMPData+Mock.swift where mspaMode is passed) to include at least one non-nil concrete value from the MSPAMode enum (e.g., a specific case) instead of nil, and add/update the corresponding test assertion to validate the ordinal serialization path for that concrete mspaMode value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@android/src/main/java/com/usercentrics/reactnative/extensions/UsercentricsCMPDataExtensions.kt`:
- Line 226: The code currently maps "resurfacePeriod" to
getResurfacePeriodCompat(), which wrongfully converts the legacy boolean
ended-state into a numeric period; update the mapping so "resurfacePeriod" is
only populated from the actual getResurfacePeriod() SDK method when available,
and do not synthesize 0/1 from the legacy flag. Instead, on the fallback path
use the legacy boolean field name (e.g., expose getResurfacePeriodEnded() /
isResurfacePeriodEnded() as "resurfacePeriodEnded") so JS receives the correct
semantics; modify getResurfacePeriodCompat() to stop returning a numeric 0/1 or
remove its use, and apply the same change to the other mapping block covering
the region referenced (lines ~252-263) so only real period values populate
"resurfacePeriod" and legacy booleans are exposed under a distinct key.
In `@src/models/CCPASettings.tsx`:
- Around line 17-18: Replace the mspaMode field's type from number to a new
exported TypeScript enum (e.g., export enum MSPAMode) that mirrors the native
SDK enum ordinals, update any constructor/creation sites and the CCPASettings
type in src/models/CCPASettings.tsx to use MSPAMode instead of number (leave
mspaCoveredTransaction as-is), and add a re-export for MSPAMode (and
CCPASettings if not already) from src/index.tsx so the enum is publicly
available to consumers.
In `@src/models/TCF2Settings.tsx`:
- Around line 38-39: The public payload shape was changed by replacing
resurfacePeriodEnded with resurfacePeriod; restore compatibility by keeping the
legacy boolean alongside the new numeric value: update the TCF2Settings
type/props to include both resurfacePeriod: number and resurfacePeriodEnded:
boolean (mark as deprecated in comments), and update the getCMPData()
implementation to populate resurfacePeriodEnded based on the existing logic (or
derive it from resurfacePeriod if that’s the intended mapping) while still
returning resurfacePeriod; ensure any places that set or read
resurfacePeriodEnded (including where resurfacePurposeChanged is used) continue
to work by writing both fields.
---
Nitpick comments:
In `@sample/ios/sampleTests/Fake/FakeUsercentricsManager.swift`:
- Around line 111-116: The stored gppSectionChangeCallback in
FakeUsercentricsManager is kept alive independently of the returned
subscription; update onGppSectionChange to clear or gate that stored callback
when the subscription is disposed by returning a UsercentricsDisposableEvent
whose dispose/teardown closure sets gppSectionChangeCallback = nil (and still
forwards payloads while subscribed), ensuring gppSectionChangeCallback is
assigned on subscribe and cleared on disposal so old observers cannot be invoked
after cleanup.
In `@sample/ios/sampleTests/Mock/CMPData`+Mock.swift:
- Around line 281-283: The mock constructor in CMPData+Mock.swift currently sets
mspaMode: nil so the ordinal-serialization branch remains untested; update the
mock(s) that build CMPData (the factory in CMPData+Mock.swift where mspaMode is
passed) to include at least one non-nil concrete value from the MSPAMode enum
(e.g., a specific case) instead of nil, and add/update the corresponding test
assertion to validate the ordinal serialization path for that concrete mspaMode
value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5c77709e-7562-4041-babc-6f2e88d99683
⛔ Files ignored due to path filters (3)
legacy-sample/package-lock.jsonis excluded by!**/package-lock.jsonpackage-lock.jsonis excluded by!**/package-lock.jsonsample/ios/Podfile.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
CHANGELOG.mdandroid/build-legacy.gradleandroid/build.gradle.ktsandroid/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.ktandroid/src/main/java/com/usercentrics/reactnative/extensions/UsercentricsCMPDataExtensions.ktios/Extensions/GppData+Dict.swiftios/Extensions/UsercentricsCMPData+Dict.swiftpackage.jsonsample/ios/sampleTests/Fake/FakeUsercentricsManager.swiftsample/ios/sampleTests/Mock/CMPData+Mock.swiftsample/ios/sampleTests/RNUsercentricsModuleTests.swiftsrc/__tests__/mocks.tssrc/models/CCPASettings.tsxsrc/models/TCF2Settings.tsxsrc/models/UsercentricsSettings.tsx
CodeAnt-AI Description
Expose the latest privacy settings and keep SDK calls aligned with version 2.26.1
What Changed
Impact
✅ Access to new US privacy settings✅ Fewer bridge failures after SDK updates✅ Safer GPP consent updates💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes