feat: add refundHandling data processing purpose (MOB-582) - #302
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
| } else if ([p isEqualToString:@"third-party-integration"]) { | ||
| [result addObject:PLYDataProcessingPurpose.thirdPartyIntegrations]; | ||
| } else if ([p isEqualToString:@"refund-handling"]) { | ||
| [result addObject:PLYDataProcessingPurpose.refundHandling]; |
There was a problem hiding this comment.
The bridge directly references PLYDataProcessingPurpose.refundHandling, but the podspec still pins Purchasely iOS 6.1.0 and the documentation identifies this property as requiring iOS 6.2.0 or later. Normal CocoaPods consumer builds and the iOS CI jobs therefore compile this source against an SDK where the property is unavailable, preventing the iOS target from compiling until the dependency is bumped or the access is made backward-compatible.
Greptile automatically discovered a related ticket stating that tests cannot run until the supporting iOS SDK ships, which informed this comment.
Source Used: Linear — [React Native] Add the refundHandling data processing purpose
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/purchasely/ios/PurchaselyRN.m
Line: 1264
Comment:
**Pinned SDK Breaks Compilation**
The bridge directly references `PLYDataProcessingPurpose.refundHandling`, but the podspec still pins Purchasely iOS 6.1.0 and the documentation identifies this property as requiring iOS 6.2.0 or later. Normal CocoaPods consumer builds and the iOS CI jobs therefore compile this source against an SDK where the property is unavailable, preventing the iOS target from compiling until the dependency is bumped or the access is made backward-compatible.
Greptile automatically discovered a related ticket stating that tests cannot run until the supporting iOS SDK ships, which informed this comment.
**Source Used:** Linear — [\[React Native\] Add the refundHandling data processing purpose](https://linear.app/purchasely/issue/MOB-582/react-native-add-the-refundhandling-data-processing-purpose)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| } else if ([p isEqualToString:@"refund-handling"]) { | ||
| [result addObject:PLYDataProcessingPurpose.refundHandling]; |
There was a problem hiding this comment.
refund-handling cannot be combined with all-non-essentials as the new documentation requires. The mapper returns immediately when it encounters all-non-essentials, discarding a refund purpose already mapped and never examining later purposes. As a result, the documented [ALL_NON_ESSENTIALS, REFUND_HANDLING] call revokes only the bundle and silently omits refund handling.
Greptile automatically discovered a related ticket stating that refund handling must remain outside allNonEssentials and carry its own revoked-consent flag, which informed this comment.
Source Used: Linear — [React Native] Add the refundHandling data processing purpose
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/purchasely/ios/PurchaselyRN.m
Line: 1263-1264
Comment:
**Combined Purpose Is Dropped**
`refund-handling` cannot be combined with `all-non-essentials` as the new documentation requires. The mapper returns immediately when it encounters `all-non-essentials`, discarding a refund purpose already mapped and never examining later purposes. As a result, the documented `[ALL_NON_ESSENTIALS, REFUND_HANDLING]` call revokes only the bundle and silently omits refund handling.
Greptile automatically discovered a related ticket stating that refund handling must remain outside `allNonEssentials` and carry its own revoked-consent flag, which informed this comment.
**Source Used:** Linear — [\[React Native\] Add the refundHandling data processing purpose](https://linear.app/purchasely/issue/MOB-582/react-native-add-the-refundhandling-data-processing-purpose)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| // Grant all purposes back | ||
| Purchasely.revokeDataProcessingConsent([]); |
There was a problem hiding this comment.
The new “Grant all purposes back” example is not supported by either bridge. An empty array maps to an empty set, after which both iOS and Android return without invoking the native SDK. Applications following this example therefore leave previously revoked purposes unchanged instead of re-granting consent.
Prompt To Fix With AI
This is a comment left during a code review.
Path: sdk_public_doc.md
Line: 824-825
Comment:
**Empty Reset Does Nothing**
The new “Grant all purposes back” example is not supported by either bridge. An empty array maps to an empty set, after which both iOS and Android return without invoking the native SDK. Applications following this example therefore leave previously revoked purposes unchanged instead of re-granting consent.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
Adds
PLYDataProcessingPurpose.REFUND_HANDLING = 'refund-handling'(MOB-582), mirroring iOS Purchasely/Purchasely-iOS-Sources#804.enums.ts: new member.revokeDataProcessingConsentforwards the string unchanged, no JS change needed.PurchaselyRN.mmapPurposesFromStrings::"refund-handling"→PLYDataProcessingPurpose.refundHandling. Deliberately not folded into theall-non-essentialsbranch (the native bundle excludes it, same asidentifiedAnalytics). Flag-only: no adapter, no local behavior.refund-handlingis a no-op there.sdk_public_doc.md: new "Data Processing Consent" section documenting the purposes table and the replace semantics (each call overwrites the revoked set; pass the full list;[]re-grants all).mapPurposesFromStrings:exposed via a test-only category: both naming conventions, combination,all-non-essentialsexclusion, every kebab token, unknown-token drop).Release sequencing
PLYDataProcessingPurpose.refundHandlingdoes not exist in Purchasely iOS 6.1.0, which the podspec still pins, so thebuild-ios/iOS Unit Tests (bridge)CI jobs will fail until the iOS release ships and the podspec is bumped. Per agreement, no podspec bump in this PR.Validated locally against the iOS sources branch of #804 (
7c10f9e): built the simulator xcframework viabuild_spm.sh, pointed the example Podfile at it, and ranreact-native-purchasely-Unit-Testson iOS 26.5 — 88 tests, 0 failures (46 inPurchaselyRNTests, incl. the 5 new ones).yarn lint/yarn typecheck/yarn test(286) green.Link to Devin session: https://app.devin.ai/sessions/1746697af7274efba1a6b15c2b6c19d6
Open in Devin Desktop: https://app.devin.ai/desktop/session/1746697af7274efba1a6b15c2b6c19d6?variant=devin
Requested by: @kherembourg