Skip to content

Conversation

NidhiDixit09
Copy link
Collaborator

Reference

EMT-2426 - https://branch.atlassian.net/browse/EMT-2426

Summary

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.

Copy link
Contributor

Code Quality bug fix

Summary By MatterAI MatterAI logo

🔄 What Changed

This Pull Request modifies two conditional checks within BNCRequestFactory.m. Specifically, the conditions for loadDataFromThirdPartyAPIs and addODMInfoToJSON methods have been updated. Previously, these operations would only proceed if the attributionLevel was explicitly BranchAttributionLevelFull. Now, they will also execute if the attributionLevel has not yet been initialized, ensuring broader data collection coverage. 🚀

🔍 Impact of the Change

The primary impact is improved data collection reliability. By including the !attributionLevelInitialized check, the system will now send ODM (Open Data Management) information and load data from third-party APIs even in scenarios where the attribution level hasn't been explicitly set. This prevents potential data gaps and ensures that critical tracking information is captured from the outset, enhancing the accuracy of attribution data. ✅

📁 Total Files Changed

  • Sources/BranchSDK/BNCRequestFactory.m: Modified two conditional statements to include a check for uninitialized attribution level.

🧪 Test Added

No specific tests were added or modified in this Pull Request. ❌

🔒Security Vulnerabilities

No new security vulnerabilities were introduced, nor were any existing ones directly addressed by these changes. The modification is focused on data collection logic. 🛡️

Tanka Poem ♫

Level not yet known,
Still, the data flows freely,
No gap in the stream.
Attribution's truth now clearer,
Science tracks, with every beat. 🔬

Sequence Diagram

sequenceDiagram
    participant RF as BNCRequestFactory
    participant PH as PreferenceHelper

    RF->>+RF: loadDataFromThirdPartyAPIs()
    RF->>PH: attributionLevelInitialized()
    PH-->>RF: isInitialized (bool)
    RF->>PH: attributionLevel()
    PH-->>RF: level (string)

    alt !isInitialized || level == BranchAttributionLevelFull
        RF->>RF: dispatch_group_enter(apiGroup)
        RF->>RF: dispatch_async(concurrentQueue, ^{ ... })
    else Other Attribution Level
        RF->>RF: Skip API loading
    end
    RF-->>-RF: Return

    RF->>+RF: addODMInfoToJSON(json)
    RF->>PH: attributionLevelInitialized()
    PH-->>RF: isInitialized (bool)
    RF->>PH: attributionLevel()
    PH-->>RF: level (string)

    alt !isInitialized || level == BranchAttributionLevelFull
        RF->>RF: Check if odmInfo exists
        alt odmInfo exists
            RF->>RF: safeSetValue(odmInfo, BRANCH_REQUEST_KEY_ODM_INFO, json)
        end
    else Other Attribution Level
        RF->>RF: Skip adding ODM info
    end
    RF-->>-RF: Return
Loading

Copy link
Contributor

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 NidhiDixit09 merged commit 4e1e300 into master Sep 9, 2025
27 of 31 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.

2 participants