Skip to content

Commit

Permalink
[Release] Version 1.5.2
Browse files Browse the repository at this point in the history
* Fix for thread issue

* Rectified

* Strong self for Background task

* Updated Thread for making calls

* Initial Fixes for Thread RaceCondition

* Thread Issue

* traitsFix - No errors

* Improvement

* Multiple externalId fix

* Synchronised dict method of various classes and improved code.

* Improved code.

* Improved thread implementation

* Reverted back unrequired changes.

* Reverted back unrequired changes.

* Optimised code

* Optimised code

* Optimised EventRepository

* Optimised EventRepository

* Optimised Context class.

* Improved externalIds handling in Context class.

* Reverting externalId optimisation.

* Addressing Comments: Removed synchronised block from Context `dict` method.

* Optimised Code

* Update EventRepository.m

* Optimised externIds in Context, Synchronised two other race conditions in: Option and EventRepository.

Co-authored-by: Pallab Maiti <pallab@rudderstack.com>
Co-authored-by: Desu Sai Venkat <saivenkatdesu@gmail.com>

* [BugFix] Thread issue (#123)

* Rectified

* Strong self for Background task

* Updated Thread for making calls

* Initial Fixes for Thread RaceCondition

* Thread Issue

* traitsFix - No errors

* Improvement

* Multiple externalId fix

* Synchronised dict method of various classes and improved code.

* Improved code.

* Improved thread implementation

* Reverted back unrequired changes.

* Reverted back unrequired changes.

* Optimised code

* Optimised code

* Optimised EventRepository

* Optimised EventRepository

* Optimised Context class.

* Improved externalIds handling in Context class.

* Reverting externalId optimisation.

* Addressing Comments: Removed synchronised block from Context `dict` method.

* Optimised Code

* Update EventRepository.m

* Optimised externIds in Context, Synchronised two other race conditions in: Option and EventRepository.

* Bumped version to 1.5.2

Co-authored-by: Pallab Maiti <pallab@rudderstack.com>
Co-authored-by: Desu Sai Venkat <saivenkatdesu@gmail.com>

Co-authored-by: Pallab Maiti <pallab@rudderstack.com>
Co-authored-by: Desu Sai Venkat <saivenkatdesu@gmail.com>
  • Loading branch information
3 people committed Feb 16, 2022
1 parent 30ea531 commit d875bb1
Show file tree
Hide file tree
Showing 23 changed files with 399 additions and 268 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ All notable changes to this project will be documented in this file.
## Version - 1.5.1 - 2022-02-11
### Fix
- Removed warnings

## Version - 1.5.2 - 2022-02-16
### Fix
- Thread issue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableASanStackUseAfterReturn = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -20,12 +18,50 @@
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DIf-Gm-9gZ">
<rect key="frame" x="80" y="298" width="136" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="ManageThreads"/>
<connections>
<action selector="manageThreads:" destination="whP-gf-Uak" eventType="touchUpInside" id="Jb7-6A-fE3"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kfr-Nc-oPb">
<rect key="frame" x="136" y="79" width="149" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Different externalId"/>
<connections>
<action selector="identifyDifferentExternalId:" destination="whP-gf-Uak" eventType="touchUpInside" id="0gj-Lo-wgf"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="O0o-4Q-7aM">
<rect key="frame" x="33" y="167" width="125" height="101"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Track"/>
<connections>
<action selector="track:" destination="whP-gf-Uak" eventType="touchUpInside" id="CYM-gm-6QV"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BCw-vL-pfH">
<rect key="frame" x="65" y="456" width="127" height="81"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Reset"/>
<connections>
<action selector="reset:" destination="whP-gf-Uak" eventType="touchUpInside" id="l7L-9X-ncJ"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="305" y="433"/>
<point key="canvasLocation" x="304.80000000000001" y="432.23388305847078"/>
</scene>
</scenes>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ @implementation _ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Do any additional setup after loading the view, typically from a nib.

// [[RSClient sharedInstance] identify:@"test_user_id" traits:@{
// @"firstName": @"Test",
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ PODS:
- nanopb/encode (1.30906.0)
- PromisesObjC (1.2.12)
- Protobuf (3.19.1)
- Rudder (1.5.0)
- Rudder (1.5.2)

DEPENDENCIES:
- Firebase/Analytics
Expand Down Expand Up @@ -120,7 +120,7 @@ SPEC CHECKSUMS:
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
Protobuf: 3724efa50cb2846d7ccebc8691c574e85fd74471
Rudder: 95d023a3a4ec1e8d6bd15963e84f78707b13d9c3
Rudder: 557cc105d77f365821d78403b1abacfd2e3018de

PODFILE CHECKSUM: 33b0e9f1b94a028aa8a3b4aecf718a44c9b6265e

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ The iOS SDK is available through [**CocoaPods**](https://cocoapods.org), [**Cart
To install the SDK, simply add the following line to your Podfile:

```xcode
pod 'Rudder', '1.5.1'
pod 'Rudder', '1.5.2'
```

### Carthage

For Carthage support, add the following line to your `Cartfile`:

```xcode
github "rudderlabs/rudder-sdk-ios" "v1.5.1"
github "rudderlabs/rudder-sdk-ios" "v1.5.2"
```

> Remember to include the following code in all `.m` and `.h` files where you want to refer to or use the RudderStack SDK classes, as shown:
Expand All @@ -71,7 +71,7 @@ You can also add the RudderStack iOS SDK via Swift Package Mangaer, via one of t

* Enter the package repository (`git@github.com:rudderlabs/rudder-sdk-ios.git`) in the search bar.

* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.5.1` as the value, as shown:
* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.5.2` as the value, as shown:

![Setting dependency](https://user-images.githubusercontent.com/59817155/145574696-8c849749-13e0-40d5-aacb-3fccb5c8e67d.png)

Expand Down Expand Up @@ -99,7 +99,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "git@github.com:rudderlabs/rudder-sdk-ios.git", from: "1.5.1")
.package(url: "git@github.com:rudderlabs/rudder-sdk-ios.git", from: "1.5.2")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
2 changes: 1 addition & 1 deletion Rudder.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Rudder'
s.version = "1.5.1"
s.version = "1.5.2"
s.summary = "Privacy and Security focused Segment-alternative. iOS ,tvOS and watchOS SDK"
s.description = <<-DESC
Rudder is a platform for collecting, storing and routing customer event data to dozens of tools. Rudder is open-source, can run in your cloud environment (AWS, GCP, Azure or even your data-centre) and provides a powerful transformation framework to process your event data on the fly.
Expand Down
4 changes: 2 additions & 2 deletions Rudder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.5.1;
MARKETING_VERSION = 1.5.2;
PRODUCT_BUNDLE_IDENTIFIER = com.rudderstack.Rudder;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1055,7 +1055,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.5.1;
MARKETING_VERSION = 1.5.2;
PRODUCT_BUNDLE_IDENTIFIER = com.rudderstack.Rudder;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
17 changes: 10 additions & 7 deletions Sources/Classes/Ecomm/RSECommerceCheckout.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
@implementation RSECommerceCheckout

- (NSDictionary *)dict {
NSMutableDictionary *tempDictionary = [[NSMutableDictionary alloc] init];
NSMutableDictionary *tempDictionary;
@synchronized (tempDictionary) {
tempDictionary = [[NSMutableDictionary alloc] init];

[tempDictionary setValue:_checkoutId forKey:@"checkout_id"];
[tempDictionary setValue:_orderId forKey:@"order_id"];
[tempDictionary setValue:[[NSNumber alloc] initWithInt:_step] forKey:@"step"];
[tempDictionary setValue:_shippingMethod forKey:@"shipping_method"];
[tempDictionary setValue:_paymentMethod forKey:@"payment_method"];
[tempDictionary setValue:_checkoutId forKey:@"checkout_id"];
[tempDictionary setValue:_orderId forKey:@"order_id"];
[tempDictionary setValue:[[NSNumber alloc] initWithInt:_step] forKey:@"step"];
[tempDictionary setValue:_shippingMethod forKey:@"shipping_method"];
[tempDictionary setValue:_paymentMethod forKey:@"payment_method"];

return [tempDictionary copy];
return [tempDictionary copy];
}
}

@end
4 changes: 3 additions & 1 deletion Sources/Classes/Public/RSContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ extern int const RSATTAuthorize;
@property (nonatomic, readwrite) RSDeviceInfo* device;
@property (nonatomic, readwrite) RSNetwork* network;
@property (nonatomic, readwrite) NSString* timezone;
@property (nonatomic, readwrite) NSMutableArray* externalIds;
@property (nonatomic, readwrite) NSMutableArray<NSMutableDictionary<NSString*, NSObject*>*>* externalIds;


+ (dispatch_queue_t) getQueue;
- (NSDictionary<NSString* , NSObject *>*) dict;
- (void) resetTraits;
- (void) updateTraits: (RSTraits* _Nullable) traits;
Expand Down
15 changes: 9 additions & 6 deletions Sources/Classes/RSApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ - (instancetype)init
}

- (NSDictionary<NSString *,NSObject *> *)dict {
NSMutableDictionary *tempDict = [[NSMutableDictionary alloc] init];
NSMutableDictionary *tempDict;
@synchronized (tempDict) {
tempDict = [[NSMutableDictionary alloc] init];

[tempDict setValue:_build forKey:@"build"];
[tempDict setValue:_name forKey:@"name"];
[tempDict setValue:_nameSpace forKey:@"namespace"];
[tempDict setValue:_version forKey:@"version"];
[tempDict setValue:_build forKey:@"build"];
[tempDict setValue:_name forKey:@"name"];
[tempDict setValue:_nameSpace forKey:@"namespace"];
[tempDict setValue:_version forKey:@"version"];

return [tempDict copy];
return [tempDict copy];
}
}
@end
3 changes: 2 additions & 1 deletion Sources/Classes/RSClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ - (void)identify:(NSString *)userId traits:(NSDictionary *)traits options:(RSOpt
[builder setTraits:traitsObj];
[builder setExternalIds:options];
[builder setRSOption:options];
[self dumpInternal:[builder build] type:RSIdentify];
RSMessage *message = [builder build];
[self dumpInternal: message type:RSIdentify];
}

- (void)reset {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Classes/RSConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ @implementation RSConstants
bool const RSTrackLifeCycleEvents = YES;
bool const RSRecordScreenViews = NO;
bool const RSEnableBackgroundMode = NO;
NSString *const RS_VERSION = @"1.5.1";
NSString *const RS_VERSION = @"1.5.2";
NSString* const DISABLE = @"disable";
NSString* const WHITELISTED_EVENTS = @"whitelistedEvents";
NSString* const BLACKLISTED_EVENTS = @"blacklistedEvents";
Expand Down

0 comments on commit d875bb1

Please sign in to comment.