Conversation
…pe in GPP 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 · |
📝 WalkthroughWalkthroughThis PR bumps the package version from 2.25.1 to 2.26.1 across multiple configuration and build files, updates the changelog with new features and fixes, adds null-check logic in the GPP consent method, and adds an explicit type annotation in iOS code. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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 with GPP support and type fixes
WalkthroughsDescription• Release version 2.26.1 with GPP privacy framework support • Fixed Android nullable type mismatch in setGPPConsent method • Fixed iOS Swift closure return type annotation in GppData+Dict • Updated version numbers across build and package files Diagramflowchart LR
A["Version Bump<br/>2.25.1 → 2.26.1"] --> B["Android Fix<br/>setGPPConsent null handling"]
A --> C["iOS Fix<br/>Closure return type"]
A --> D["Documentation<br/>CHANGELOG update"]
B --> E["Release 2.26.1"]
C --> E
D --> E
File Changes1. android/build.gradle.kts
|
Code Review by Qodo
1. Null GPP consent ignored
|
|
PR Summary: Release 2.26.1: Adds GPP/US National support and new APIs, fixes TCF/DPS bugs, and bumps package/version metadata.
|
android/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.kt
Show resolved
Hide resolved
|
Reviewed up to commit:b1b53a67dfe8e09cd5838167af4f5b0df6f7c4e9 Few more points:
Recommendations (pick one and implement consistently):
Also update the codegen / RN interface (RNUsercentricsModuleSpec and TypeScript types) so the contract is clear. Add a focused unit/integration test that calls setGPPConsent with { value: null } from JS and asserts the native manager receives the intended null/sentinel value. Reference: android RN implementation in this PR (new lines ~151-159) and existing reference iOS bridge: ios/RNUsercentricsModule.swift lines 138-170 and RNUsercentricsModuleSpec.kt declaration lines 58-88. @ReactMethod
override fun setGPPConsent(sectionName: String, fieldName: String, value: ReadableMap) {
if (!value.hasKey("value")) {
// Option A: forward explicit null for missing key to stay aligned with iOS NSNull()
usercentricsProxy.instance.setGPPConsent(sectionName, fieldName, null)
return
}
val parsedValue: Any? = when (value.getType("value")) {
ReadableType.Null -> null
else -> readableMapValueToAny(value.getMap("value") ?: value)
}
// Forward nullable value explicitly instead of early-returning
usercentricsProxy.instance.setGPPConsent(sectionName, fieldName, parsedValue)
}And update the spec / TS types to allow // RNUsercentricsModuleSpec.kt
@ReactMethod
abstract fun setGPPConsent(sectionName: String, fieldName: String, value: ReadableMap)// src/fabric/NativeUsercentricsModule.ts
setGPPConsent(sectionName: string, fieldName: string, value: { value: unknown | null }): void;
// src/NativeUsercentrics.ts
setGPPConsent(sectionName: string, fieldName: string, value: unknown | null): void; |
android/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.kt
Show resolved
Hide resolved
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
android/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.kt (1)
151-160:⚠️ Potential issue | 🟠 MajorCross-platform inconsistency: Android silently drops null values while iOS forwards them to SDK.
The Android implementation returns early when
parsedValueis null (line 158), preventing the SDK call entirely. The iOS implementation (ios/RNUsercentricsModule.swift:153-156) usesvalue["value"] ?? NSNull()and always invokes the SDK method, passingNSNull()when the value is nil.This creates different behavior:
- Android: Null values are silently ignored; SDK method is never called
- iOS:
NSNull()is passed to the SDK; the call proceedsAlign the implementations to ensure consistent behavior across platforms. Either both should return early for null, or both should forward null (or
NSNull()) to the SDK.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@android/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.kt` around lines 151 - 160, The Android method setGPPConsent currently returns early when the "value" is missing or parsedValue is null, causing it to drop nulls unlike iOS; change it to always call usercentricsProxy.instance.setGPPConsent and pass a nullable value so nulls are forwarded to the SDK. Concretely: in RNUsercentricsModule.setGPPConsent, stop returning early on missing "value" or when readableMapValueToAny returns null; compute parsedValue as nullable (use readableMapValueToAny when key exists, otherwise null) and always invoke usercentricsProxy.instance.setGPPConsent(sectionName, fieldName, parsedValue) so the SDK receives nulls just like iOS.
🧹 Nitpick comments (1)
package.json (1)
50-51: Minor: Inconsistent version pinning for CLI platform packages.These two packages use exact versions (
18.0.0) while other devDependencies including@react-native-community/clion line 49 use caret ranges (^18.0.0). Consider using^18.0.0for consistency with the coding guidelines recommendation to use^ranges, unless there's a specific compatibility reason for exact pinning.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` around lines 50 - 51, The package.json lists "@react-native-community/cli-platform-android" and "@react-native-community/cli-platform-ios" pinned to exact "18.0.0" while "@react-native-community/cli" uses a caret range; update the two platform packages to use the caret range "^18.0.0" to match the project's versioning policy unless there is a deliberate compatibility reason, ensuring the entries for "@react-native-community/cli-platform-android" and "@react-native-community/cli-platform-ios" are changed to the caret-prefixed version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@android/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.kt`:
- Around line 151-160: The Android method setGPPConsent currently returns early
when the "value" is missing or parsedValue is null, causing it to drop nulls
unlike iOS; change it to always call usercentricsProxy.instance.setGPPConsent
and pass a nullable value so nulls are forwarded to the SDK. Concretely: in
RNUsercentricsModule.setGPPConsent, stop returning early on missing "value" or
when readableMapValueToAny returns null; compute parsedValue as nullable (use
readableMapValueToAny when key exists, otherwise null) and always invoke
usercentricsProxy.instance.setGPPConsent(sectionName, fieldName, parsedValue) so
the SDK receives nulls just like iOS.
---
Nitpick comments:
In `@package.json`:
- Around line 50-51: The package.json lists
"@react-native-community/cli-platform-android" and
"@react-native-community/cli-platform-ios" pinned to exact "18.0.0" while
"@react-native-community/cli" uses a caret range; update the two platform
packages to use the caret range "^18.0.0" to match the project's versioning
policy unless there is a deliberate compatibility reason, ensuring the entries
for "@react-native-community/cli-platform-android" and
"@react-native-community/cli-platform-ios" are changed to the caret-prefixed
version.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 858bfd8d-49b3-4020-8b8c-155022db4807
⛔ 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 (6)
CHANGELOG.mdandroid/build-legacy.gradleandroid/build.gradle.ktsandroid/src/main/java/com/usercentrics/reactnative/RNUsercentricsModule.ktios/Extensions/GppData+Dict.swiftpackage.json
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
User description
Release 2.26.1
Features
getDpsMetadata()APIFixes
setGPPConsentGppData+Dict🤖 Generated with Claude Code
CodeAnt-AI Description
Release 2.26.1 adds GPP privacy support and fixes consent handling issues
What Changed
Impact
✅ Wider privacy framework support✅ Clearer consent and DPS details✅ Fewer consent update failures💡 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
New Features
getDpsMetadata()Bug Fixes