Fixed tests to use new API to disable auto init.#1580
Fixed tests to use new API to disable auto init.#1580NidhiDixit09 merged 8 commits into4.0.0-alpha.0from
Conversation
|
✅ Reviewed the changes: The PR looks good overall. The tests are updated to use the new API to disable auto-initialization and verify Consumer Protection Attribution (CPP) levels. |
|
✅ Reviewed the changes: The PR description mentions using a new API to disable auto-initialization, but the code changes only add a |
|
✅ Reviewed the changes: The changes correctly implement the new |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: The PR description states that the old setConsumerProtectionAttributionLevel API causes auto-initialization and the fix is to use the new API with the resetSession parameter. However, this line still uses the old API, which might trigger the unwanted auto-initialization before the next line executes.
Fix: Use the new API with resetSession: false for setting the level to .none as well, to ensure auto-initialization is completely avoided.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: Similar to the iOS test, this line still uses the old setConsumerProtectionAttributionLevel API which the PR aims to replace to prevent auto-initialization.
Fix: Use the new API with resetSession: false for setting the level to .none to maintain consistency and prevent unintended side effects.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: The PR description states that the old setConsumerProtectionAttributionLevel API causes auto-initialization and the fix is to use the new API with the resetSession parameter. However, this line still uses the old API, which might trigger the unwanted auto-initialization before the next line executes.
Fix: Use the new API with resetSession: false for setting the level to .none as well, to ensure auto-initialization is completely avoided.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: Similar to the iOS test, this line still uses the old setConsumerProtectionAttributionLevel API which the PR aims to replace to prevent auto-initialization.
Fix: Use the new API with resetSession: false for setting the level to .none to maintain consistency and prevent unintended side effects.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: The PR description states that the old setConsumerProtectionAttributionLevel API causes auto-initialization and the fix is to use the new API with the resetSession parameter. However, this line still uses the old API, which might trigger the unwanted auto-initialization before the next line executes.
Fix: Use the new API with resetSession: false for setting the level to .none as well, to ensure auto-initialization is completely avoided.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: Similar to the iOS test, this line still uses the old setConsumerProtectionAttributionLevel API which the PR aims to replace to prevent auto-initialization.
Fix: Use the new API with resetSession: false for setting the level to .none to maintain consistency and prevent unintended side effects.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: The PR description states that the old setConsumerProtectionAttributionLevel API causes auto-initialization and the fix is to use the new API with the resetSession parameter. However, this line still uses the old API, which might trigger the unwanted auto-initialization before the next line executes.
Fix: Use the new API with resetSession: false for setting the level to .none as well, to ensure auto-initialization is completely avoided.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: Similar to the iOS test, this line still uses the old setConsumerProtectionAttributionLevel API which the PR aims to replace to prevent auto-initialization.
Fix: Use the new API with resetSession: false for setting the level to .none to maintain consistency and prevent unintended side effects.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: The PR description states that the old setConsumerProtectionAttributionLevel API causes auto-initialization and the fix is to use the new API with the resetSession parameter. However, this line still uses the old API, which might trigger the unwanted auto-initialization before the next line executes.
Fix: Use the new API with resetSession: false for setting the level to .none as well, to ensure auto-initialization is completely avoided.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
|
|
||
| let sdk = BranchSDKTest(){ params, error in | ||
| print(params as? [String: AnyObject] ?? {}) | ||
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) |
There was a problem hiding this comment.
🟡 Logic
Issue: Similar to the iOS test, this line still uses the old setConsumerProtectionAttributionLevel API which the PR aims to replace to prevent auto-initialization.
Fix: Use the new API with resetSession: false for setting the level to .none to maintain consistency and prevent unintended side effects.
Impact: Prevents unintended auto-initialization and deep link data loss during the test setup.
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none) | |
| Branch.getInstance().setConsumerProtectionAttributionLevel(BranchAttributionLevel.none, resetSession: false) |
Reference
Summary
SDK Binary Integration tests were using API - setConsumerProtectionAttributionLevel along with initSession. Because of autoinitialization in setConsumerProtectionAttributionLevel initsession was losing deep link data.
This PR includes fix for above issue - it uses new API -
- (void)setConsumerProtectionAttributionLevel:(BranchAttributionLevel)level resetSession:(BOOL)resetSession;- to avoid auto initialization.Type Of Change
Testing Instructions
cc @BranchMetrics/saas-sdk-devs for visibility.