BranchMetrics / ios-branch-deep-linking-attribution

The Branch iOS SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://help.branch.io/developers-hub/docs/ios-sdk-overview
MIT License
728 stars 229 forks source link

INTENG-19264 and INTENG-19577 bug fixes #1351

Closed echo-branch closed 8 months ago

echo-branch commented 8 months ago

Reference

INTENG-19264 and INTENG-19577 Although the two issues are not the same, they are in related area of code and therefore handled in a single fix PR.

Summary

Motivation

INTENG-19264 On cold link open, there are two iOS lifecycle events in a very small window of time. Our existing code improperly attempts to reconcile the two events, with a potential loss of link data. The frequency of failure depends on how much time is elapsed between the first and second lifecycle calls, a ~0.15s delay repros about 1/10 on our test app. Shorter and longer delays did not repro the issue.

Initial fix is to no longer attempt to reconcile the two close lifecycle events. This means all clients will see two callbacks on cold link open. The first is for the app initialization which will contain no link data, the second is for link data arrival.

INTENG-19577 Disable tracking resets SDK state and erases data. Our existing code did not queue the reset requests, so repeated rapid calls to this API could cause a hang. SDK reset and erase data requests are now queued.

Type Of Change

Testing Instructions

Scheduled testing session

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

codecov[bot] commented 8 months ago

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Comparison is base (c7f50be) 51.02% compared to head (e561653) 51.27%. Report is 1 commits behind head on master.

Files Patch % Lines
Sources/BranchSDK/Branch.m 56.33% 27 Missing and 4 partials :warning:
Sources/BranchSDK/BranchOpenRequest.m 25.00% 2 Missing and 1 partial :warning:
Sources/BranchSDK/BNCServerRequestQueue.m 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1351 +/- ## ========================================== + Coverage 51.02% 51.27% +0.25% ========================================== Files 66 66 Lines 10143 10092 -51 Branches 3721 3697 -24 ========================================== Hits 5175 5175 + Misses 4702 4654 -48 + Partials 266 263 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.