Skip to content
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

INTENG-21262 Fix for Duplicate purchase events (cached). #1433

Merged
merged 5 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ - (id)unarchiveObjectFromData:(NSData *)data;
// returns data in the legacy format
- (NSData *)oldArchiveQueue:(NSArray<BNCServerRequest *> *)queue;

+ (NSURL * _Nonnull) URLForQueueFile;
- (void)retrieve;

@end

@interface BNCServerRequestQueueTests : XCTestCase
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion BranchSDK.podspec
Original file line number Diff line number Diff line change
@@ -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?
Expand Down
12 changes: 6 additions & 6 deletions BranchSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Sources/BranchSDK/BNCConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 2 additions & 0 deletions Sources/BranchSDK/BNCServerRequestQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ - (void)retrieve {
}
}
self.queue = decodedQueue;
// Requests are loaded into queue now. Delete queue file stored on disk.
[self removeSaveFile];
gdeluna-branch marked this conversation as resolved.
Show resolved Hide resolved
gdeluna-branch marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Options:
USAGE
}

version=3.6.2
version=3.6.3
prev_version="$version"

if (( $# == 0 )); then
Expand Down
Loading