Skip to content

Commit 5ef2ebc

Browse files
author
Edward Smith
committed
Version 0.20.2. Fixed race condition and test.
1 parent 05a5ce5 commit 5ef2ebc

File tree

8 files changed

+27
-13
lines changed

8 files changed

+27
-13
lines changed

Branch-SDK/Branch-SDK/BNCConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
BOOL const BNC_API_PINNED = YES;
1313
NSString * const BNC_API_VERSION = @"v1";
1414
NSString * const BNC_LINK_URL = @"https://bnc.lt";
15-
NSString * const BNC_SDK_VERSION = @"0.20.1";
15+
NSString * const BNC_SDK_VERSION = @"0.20.2";
1616

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,18 @@ void ForceCategoriesToLoad(void) {
8080
BNCForceNSMutableDictionaryCategoryToLoad();
8181
}
8282

83-
8483
#pragma mark - Branch
8584

86-
87-
@interface Branch() <BranchDeepLinkingControllerCompletionDelegate, FABKit>
88-
85+
@interface Branch() <BranchDeepLinkingControllerCompletionDelegate, FABKit> {
86+
NSInteger _networkCount;
87+
}
8988

9089
@property (strong, nonatomic) BNCServerInterface *bServerInterface;
9190
@property (strong, nonatomic) BNCServerRequestQueue *requestQueue;
9291
@property (strong, nonatomic) dispatch_semaphore_t processing_sema;
9392
@property (copy, nonatomic) callbackWithParams sessionInitWithParamsCallback;
9493
@property (copy, nonatomic) callbackWithBranchUniversalObject sessionInitWithBranchUniversalObjectCallback;
95-
@property (assign, nonatomic) NSInteger networkCount;
94+
@property (assign, atomic) NSInteger networkCount;
9695
@property (assign, nonatomic) NSInteger asyncRequestCount;
9796
@property (assign, nonatomic) BOOL isInitialized;
9897
@property (assign, nonatomic) BOOL shouldCallSessionInitCallback;
@@ -1658,6 +1657,18 @@ - (void)callClose {
16581657

16591658
#pragma mark - Queue management
16601659

1660+
- (NSInteger) networkCount {
1661+
@synchronized (self) {
1662+
return _networkCount;
1663+
}
1664+
}
1665+
1666+
- (void) setNetworkCount:(NSInteger)networkCount {
1667+
@synchronized (self) {
1668+
_networkCount = networkCount;
1669+
}
1670+
}
1671+
16611672
- (void)insertRequestAtFront:(BNCServerRequest *)req {
16621673
if (self.networkCount == 0) {
16631674
[self.requestQueue insert:req at:0];

Branch-SDK/Branch-SDK/Networking/BNCServerRequestQueue.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ - (id)init {
4242
}
4343

4444
- (void) dealloc {
45-
if (self.persistTimer)
45+
if (self.persistTimer) {
4646
dispatch_source_cancel(self.persistTimer);
47+
self.persistTimer = nil;
48+
}
4749
[self persistImmediately];
4850
}
4951

Branch-TestBed/Branch-SDK-Tests/BranchNetworkScenario.Test.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ - (void)testScenario7 {
440440
// Somehow, betweeen initSession and the next call, all preference items are cleared.
441441
// Shouldn't crash in this case, but can't do much besides "you need to re-init"
442442
- (void)testScenario8 {
443+
sleep(1);
443444
BNCPreferenceHelper *preferenceHelper = [[BNCPreferenceHelper alloc] init];
444445
id serverInterfaceMock = OCMClassMock([BNCServerInterface class]);
445446

Branch-TestBed/Framework-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.20.1</string>
20+
<string>0.20.2</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>0.20.1</string>
24+
<string>0.20.2</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>NSHumanReadableCopyright</key>

Branch.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Branch"
3-
s.version = "0.20.1"
3+
s.version = "0.20.2"
44
s.summary = "Create an HTTP URL for any piece of content in your app"
55
s.description = <<-DESC
66
- Want the highest possible conversions on your sharing feature?

carthage-files/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.20.1</string>
18+
<string>0.20.2</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>0.20.1</string>
22+
<string>0.20.2</string>
2323
<key>NSPrincipalClass</key>
2424
<string></string>
2525
</dict>

scripts/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Options:
3131
USAGE
3232
}
3333

34-
version=0.20.1
34+
version=0.20.2
3535

3636
if (( $# == 0 )); then
3737
echo $version

0 commit comments

Comments
 (0)