-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK-2473] Fix for early branch init on install #1451
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1908,7 +1908,9 @@ - (BOOL)isReplayableRequest:(BNCServerRequest *)request { | |
|
||
- (void)processNextQueueItem { | ||
dispatch_semaphore_wait(self.processing_sema, DISPATCH_TIME_FOREVER); | ||
|
||
|
||
[[BranchLogger shared] logVerbose:[NSString stringWithFormat:@"Processing next queue item. Network Count: %ld. Queue depth: %ld", (long)self.networkCount, (long)self.requestQueue.queueDepth] error:nil]; | ||
|
||
if (self.networkCount == 0 && | ||
self.requestQueue.queueDepth > 0) { | ||
|
||
|
@@ -1920,10 +1922,11 @@ - (void)processNextQueueItem { | |
|
||
if (req) { | ||
|
||
// If tracking is disabled, then do not check for install event. It won't exist. | ||
// If tracking is disabled, then do not check for install event. It won't exist. | ||
if (!Branch.trackingDisabled) { | ||
if (![req isKindOfClass:[BranchInstallRequest class]] && !self.preferenceHelper.randomizedBundleToken) { | ||
[[BranchLogger shared] logError:@"User session has not been initialized!" error:nil]; | ||
self.networkCount = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be a thread safe operation? Can other areas be checking this value at the same time, and executing/not executing an event because of it? cc @NidhiDixit09 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gdeluna-branch @nsingh-branch I think we should add this fix for opens also. Its a rare case to happen but technically |
||
BNCPerformBlockOnMainThreadSync(^{ | ||
[req processResponse:nil error:[NSError branchErrorWithCode:BNCInitError]]; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to queue an event before the sdk is initialized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah