diff --git a/Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m b/Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m index 4d8664b..d99a1be 100644 --- a/Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m +++ b/Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m @@ -25,6 +25,9 @@ - (id)unarchiveObjectFromData:(NSData *)data; // returns data in the legacy format - (NSData *)oldArchiveQueue:(NSArray *)queue; ++ (NSURL * _Nonnull) URLForQueueFile; +- (void)retrieve; + @end @interface BNCServerRequestQueueTests : XCTestCase @@ -157,4 +160,27 @@ - (void)testOldArchiveArrayOfInvalidObjects { XCTAssert(unarchived.count == 2); } +- (void)testMultipleRequests { + BranchEventRequest *eventObject = [BranchEventRequest new]; + BranchOpenRequest *openObject = [BranchOpenRequest new]; + + [_queue enqueue: eventObject]; + [_queue enqueue: openObject]; + [_queue persistImmediately]; + + NSMutableArray *decodedQueue = nil; + NSData *data = [NSData dataWithContentsOfURL:[BNCServerRequestQueue URLForQueueFile] options:0 error:nil]; + if (data) { + decodedQueue = [_queue unarchiveQueueFromData:data]; + } + XCTAssert([decodedQueue count] == 2); + [_queue clearQueue]; + XCTAssert([_queue queueDepth] == 0); + [_queue retrieve]; + XCTAssert([_queue queueDepth] == 2); + + // Request are loaded. So there should not be any queue file on disk. + XCTAssert([NSFileManager.defaultManager fileExistsAtPath:[[BNCServerRequestQueue URLForQueueFile] path]] == NO); +} + @end diff --git a/BranchSDK.podspec b/BranchSDK.podspec index 51834cb..de2775d 100644 --- a/BranchSDK.podspec +++ b/BranchSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "BranchSDK" - s.version = "3.6.2" + s.version = "3.6.3" s.summary = "Create an HTTP URL for any piece of content in your app" s.description = <<-DESC - Want the highest possible conversions on your sharing feature? diff --git a/BranchSDK.xcodeproj/project.pbxproj b/BranchSDK.xcodeproj/project.pbxproj index 4cc3e30..528cd9c 100644 --- a/BranchSDK.xcodeproj/project.pbxproj +++ b/BranchSDK.xcodeproj/project.pbxproj @@ -1974,7 +1974,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.6.2; + MARKETING_VERSION = 3.6.3; OTHER_LDFLAGS = ( "-weak_framework", LinkPresentation, @@ -2009,7 +2009,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.6.2; + MARKETING_VERSION = 3.6.3; OTHER_LDFLAGS = ( "-weak_framework", LinkPresentation, @@ -2215,7 +2215,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 3.6.2; + MARKETING_VERSION = 3.6.3; OTHER_LDFLAGS = ( "-weak_framework", LinkPresentation, @@ -2254,7 +2254,7 @@ "@loader_path/Frameworks", ); MACH_O_TYPE = staticlib; - MARKETING_VERSION = 3.6.2; + MARKETING_VERSION = 3.6.3; OTHER_LDFLAGS = ( "-weak_framework", LinkPresentation, @@ -2291,7 +2291,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.6.2; + MARKETING_VERSION = 3.6.3; OTHER_LDFLAGS = ( "-weak_framework", LinkPresentation, @@ -2326,7 +2326,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.6.2; + MARKETING_VERSION = 3.6.3; OTHER_LDFLAGS = ( "-weak_framework", LinkPresentation, diff --git a/ChangeLog.md b/ChangeLog.md index d082a2f..0b3065d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,8 @@ Branch iOS SDK Change Log +v.3.6.3 +- Fix for duplicate events created from archived request queue on disk. + v.3.6.2 - Fix for issue which was sending an extra open request on cold app launch. - Updated fix for cold link launch when using deferred initialization and an AppDelegate only app. diff --git a/Sources/BranchSDK/BNCConfig.m b/Sources/BranchSDK/BNCConfig.m index cbba9b3..2b661ef 100644 --- a/Sources/BranchSDK/BNCConfig.m +++ b/Sources/BranchSDK/BNCConfig.m @@ -8,7 +8,7 @@ #include "BNCConfig.h" -NSString * const BNC_SDK_VERSION = @"3.6.2"; +NSString * const BNC_SDK_VERSION = @"3.6.3"; NSString * const BNC_LINK_URL = @"https://bnc.lt"; NSString * const BNC_CDN_URL = @"https://cdn.branch.io"; diff --git a/Sources/BranchSDK/BNCServerRequestQueue.m b/Sources/BranchSDK/BNCServerRequestQueue.m index 2fefbc4..2147f0f 100755 --- a/Sources/BranchSDK/BNCServerRequestQueue.m +++ b/Sources/BranchSDK/BNCServerRequestQueue.m @@ -287,6 +287,8 @@ - (void)retrieve { } } self.queue = decodedQueue; + // Requests are loaded into queue now. Delete queue file stored on disk. + [self removeSaveFile]; } } } diff --git a/scripts/version.sh b/scripts/version.sh index 952184f..70c4ee2 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -30,7 +30,7 @@ Options: USAGE } -version=3.6.2 +version=3.6.3 prev_version="$version" if (( $# == 0 )); then