Skip to content

Conversation

@uc-brunosouza
Copy link
Collaborator

@uc-brunosouza uc-brunosouza commented Nov 7, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where consent mediation configuration settings were being misread, ensuring proper and accurate handling of user consent preferences on iOS.

@uc-brunosouza uc-brunosouza self-assigned this Nov 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

A bug fix in an iOS extension that corrects the dictionary key used to read the consentMediation flag. The code was previously reading from the incorrect "networkMode" key and now correctly reads from "consentMediation".

Changes

Cohort / File(s) Change Summary
Bug fix: Dictionary key correction
ios/Extensions/UsercentricsOptions+Dict.swift
Fixed incorrect dictionary key lookup for consentMediation flag (changed from "networkMode" to "consentMediation")

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-line key string correction with straightforward impact
  • No logic changes or control flow modifications

Poem

🐰 A key was misplaced, oh what a mix,
"networkMode" read, but 'twas wrong to fix,
"consentMediation" now shines so bright,
Dictionary lookup now rings just right! 🔑✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing the consentMediation map value by correcting which dictionary key is read.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/consent-mediation-map-value

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11d34c1 and e38d1ce.

📒 Files selected for processing (1)
  • ios/Extensions/UsercentricsOptions+Dict.swift (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-android
  • GitHub Check: test-ios
🔇 Additional comments (1)
ios/Extensions/UsercentricsOptions+Dict.swift (1)

36-38: Fix is correct and properly integrated across platform.

The iOS change correctly reads consentMediation from its own dictionary key as a Bool, fixing the bug where it was incorrectly read from "networkMode" (an Int). Verification confirms:

  • TypeScript model defines consentMediation?: Boolean
  • Android implementation also reads from "consentMediation" key
  • Test mocks use the correct "consentMediation" key in all dictionary constructions
  • Native module properly passes the dictionary to the Swift extension

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pantoaibot
Copy link

pantoaibot bot commented Nov 7, 2025

PR Summary:

Fixes an error where the "consentMediation" value was mapped using the wrong dictionary key. The change now properly retrieves a Boolean value from the "consentMediation" key instead of "networkMode".

Reviewed by Panto AI

}

if let consentMediationValue = dictionary["networkMode"] as? Bool {
if let consentMediationValue = dictionary["consentMediation"] as? Bool {
Copy link

Choose a reason for hiding this comment

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

[REFACTORING] The patch correctly updates the key from 'networkMode' to 'consentMediation', which aligns with the expected mapping (see reference code block at ios/Extensions/UsercentricsOptions+Dict.swift, lines 28-34 and sample tests). Ensure that any associated logic or tests that depend on 'consentMediation' properly reflect this change to avoid potential regressions.

@pantoaibot
Copy link

pantoaibot bot commented Nov 7, 2025

Reviewed up to commit:e38d1ce4dec885b62454e39324c9546a25191dab

Reviewed by Panto AI

@uc-brunosouza uc-brunosouza merged commit caf0201 into master Nov 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants