Skip to content

Conversation

@bboothe-branch
Copy link
Contributor

Reference

SDK-2556 -- <TITLE>.

Summary

Bumping iOS SDK native version to 3.13.3
Exposing 3 functions

  • setODMInfo
  • setAnonID
  • setSDKWaitTimeForThirdPartyAPIs

Motivation

Type Of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing Instructions

cc @BranchMetrics/saas-sdk-devs for visibility.

@matter-code-review
Copy link

matter-code-review bot commented Oct 23, 2025

Code Quality new feature

Summary By MatterAI MatterAI logo

🔄 What Changed

  • Added iOS platform guards for setSDKWaitTimeForThirdPartyAPIs, setAnonID, and setODMInfo to prevent invocation on non-iOS platforms
  • Implemented warning logs when methods are called on unsupported platforms
  • Finalized exposure of three native iOS SDK functions

🔍 Impact of the Change

Ensures platform-specific methods are safely gated behind runtime OS checks, preventing unintended behavior or crashes on Android. Improves developer experience by providing clear console warnings instead of silent failures or native exceptions. Complements prior input validation with platform-level defense.

📁 Total Files Changed

File ChangeLog
Platform Guarding src/index.js Added Platform.OS !== 'ios' checks with console.warn and early returns for all three exposed iOS-only methods

🧪 Test Added/Recommended

Recommended

  • Add unit tests to verify platform guard logic (e.g., expect no native call and only warning log when called on Android)
  • Test iOS-specific execution path to ensure native methods are invoked only on correct platform
  • Mock Platform.OS to validate cross-platform behavior in test environment

🔒 Security Vulnerabilities

No security vulnerabilities detected. Platform checks prevent misuse of iOS-only APIs on other platforms, reducing attack surface and improving runtime safety. Combined with prior input validation, the implementation is robust and secure.

Caution

Package Vulnerabilities

Package Version Severity CVE Fix Version Vulnerability
@babel/runtime ^7.20.0 MODERATE CVE-2025-27789 7.26.10 Babel has inefficient
RegExp complexity
in generated
code with
.replace when
transpiling named
capturing groups
react-native >= 0.60 HIGH CVE-2020-1920 0.62.3 Regular expression denial
of service
in react-native

⏳ Estimated code review effort

LOW (~7 minutes)

Tip

Quality Recommendations

  1. Add unit tests with Platform.OS mock to validate platform guard behavior

  2. Ensure all warnings include method name for easier debugging

  3. Consider using a shared utility for platform checks to reduce duplication

♫ Tanka Poem

Code guards now stand tall 🌳
Only iOS may pass through the wall
Warnings light the way
No more silent fails today
Bridge shines, safe and clear ✨

Sequence Diagram

sequenceDiagram
    participant JS as JavaScript Layer
    participant Platform as Platform.OS
    participant Native as iOS Native SDK

    JS->>Platform: Check OS

    alt OS is not iOS
        JS-->>JS: console.warn('[Branch] method is iOS-only')
        JS-->>JS: return early
    else OS is iOS
        JS->>Native: Forward call with validated params
        Native-->>JS: Return result or error
    end
Loading

@matter-code-review
Copy link

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@matter-code-review
Copy link

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@matter-code-review
Copy link

Note

PR Review Skipped

PR review skipped as no relevant changes found due to large diff hunk OR part of a non-reviewable file.

📄Files skipped in review
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@matter-code-review
Copy link

Note

PR Review Skipped

PR review skipped as no relevant changes found due to large diff hunk OR part of a non-reviewable file.

📄Files skipped in review
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
  • undefined: undefined
💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@matter-code-review
Copy link

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@matter-code-review
Copy link

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@matter-code-review
Copy link

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@NidhiDixit09
Copy link
Contributor

/matter review-full

Copy link

@matter-code-review matter-code-review bot left a comment

Choose a reason for hiding this comment

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

🧪 PR Review is completed: PR updates iOS SDK and exposes new JS functions. Key areas reviewed: SDK versioning, native method bridging, and type safety.

Skipped files
  • ChangeLog.md: Skipped file pattern
  • branchreactnativetestbed/ios/Podfile.lock: Skipped file pattern
  • branchreactnativetestbed/package-lock.json: Skipped file pattern
  • package-lock.json: File hunk diff too large
⬇️ Low Priority Suggestions (1)
ios/RNBranch.m

Location: ios/RNBranch.m (Lines 788-788)

🟡 Code Quality

Issue: The comment // CRASH GUARD: This is mandatory. We only convert the timestamp if the NSNumber object is valid. while descriptive, uses informal language (CRASH GUARD) and could be more precise about what constitutes a 'valid' NSNumber in this context (e.g., non-nil, not NaN).

Fix: Rephrase for clarity and professionalism, e.g., // Safety check: Only convert timestamp if NSNumber is non-nil.

Impact: Improves code readability and maintainability

-      // CRASH GUARD: This is mandatory. We only convert the timestamp if the NSNumber object is valid.
+      // Safety check: Only convert timestamp if NSNumber is non-nil.
+  

@matter-code-review
Copy link

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@matter-code-review
Copy link

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use MatterAI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with MatterAI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

@bboothe-branch bboothe-branch merged commit 66790e9 into master Oct 27, 2025
6 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.

3 participants