Skip to content

Commit

Permalink
[Bugfix] Fixed additional / issue in the URL for Data Plane and Con…
Browse files Browse the repository at this point in the history
…trol Plane
  • Loading branch information
desusai7 committed Jun 28, 2022
1 parent b4ee337 commit 69615f7
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 45 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ All notable changes to this project will be documented in this file.
## Version - 1.6.1 - 2022-06-20
- Included Build Number as well in the life cycle events Application Installed & Application Updated.
- Accepting path as well as part of the url for both control plane url and data plane url.

## Version - 1.6.2 - 2022-06-28
- Fixed additional / in the url for both control plane url and dataplaneurl as a result of which the network requests to both control plane and data plane url are being failed.
24 changes: 3 additions & 21 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
PODS:
- AppsFlyerFramework (6.4.4):
- AppsFlyerFramework/Main (= 6.4.4)
- AppsFlyerFramework/Main (6.4.4)
- Firebase/Analytics (6.34.0):
- Firebase/Core
- Firebase/Core (6.34.0):
Expand Down Expand Up @@ -82,25 +79,15 @@ PODS:
- nanopb/encode (1.30906.0)
- PromisesObjC (1.2.12)
- Protobuf (3.20.1)
- Rudder (1.6.0)
- Rudder-Appsflyer (1.1.0):
- AppsFlyerFramework (~> 6.4.3)
- Rudder (~> 1.0)
- Rudder-Firebase (1.0.2):
- Firebase/Core
- FirebaseAnalytics
- Rudder
- Rudder (1.6.2)

DEPENDENCIES:
- Firebase/Analytics
- Firebase/Messaging
- Rudder (from `.`)
- Rudder-Appsflyer (= 1.1.0)
- Rudder-Firebase

SPEC REPOS:
trunk:
- AppsFlyerFramework
- Firebase
- FirebaseAnalytics
- FirebaseCore
Expand All @@ -114,15 +101,12 @@ SPEC REPOS:
- nanopb
- PromisesObjC
- Protobuf
- Rudder-Appsflyer
- Rudder-Firebase

EXTERNAL SOURCES:
Rudder:
:path: "."

SPEC CHECKSUMS:
AppsFlyerFramework: 6ea252ecb04cf443550576922cddb95b35c958ed
Firebase: c23a36d9e4cdf7877dfcba8dd0c58add66358999
FirebaseAnalytics: 3bb096873ee0d7fa4b6c70f5e9166b6da413cc7f
FirebaseCore: d3a978a3cfa3240bf7e4ba7d137fdf5b22b628ec
Expand All @@ -136,10 +120,8 @@ SPEC CHECKSUMS:
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
Protobuf: b60ec2f51ad74765f44d0c09d2e0579d7de21745
Rudder: f2cb6780d8b2e261f830b47a44333e55be9ce68e
Rudder-Appsflyer: 7b1b9b66513f70ac9c305ee28febbc72ce37a746
Rudder-Firebase: 42b9a7d143cbe6d125f5bdf535cba73e24cba1c1
Rudder: 57717e83b632760b411636ee532e16008698520e

PODFILE CHECKSUM: d5ddcdfc9129105310a8c03f048b4d0ec5e232d8
PODFILE CHECKSUM: 33b0e9f1b94a028aa8a3b4aecf718a44c9b6265e

COCOAPODS: 1.11.3
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<p align="center">
<a href="https://cocoapods.org/pods/Rudder">
<img src="https://img.shields.io/static/v1?label=pod&message=v1.6.1&color=blue&style=flat">
<img src="https://img.shields.io/static/v1?label=pod&message=v1.6.2&color=blue&style=flat">
</a>
</p>

Expand Down 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.6.1'
pod 'Rudder', '1.6.2'
```

### Carthage

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

```xcode
github "rudderlabs/rudder-sdk-ios" "v1.6.1"
github "rudderlabs/rudder-sdk-ios" "v1.6.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.6.1` as the value, as shown:
* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.6.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.6.1")
.package(url: "git@github.com:rudderlabs/rudder-sdk-ios.git", from: "1.6.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.6.1"
s.version = "1.6.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.6.1;
MARKETING_VERSION = 1.6.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.6.1;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = com.rudderstack.Rudder;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
1 change: 1 addition & 0 deletions Sources/Classes/Public/RSUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (int) getNumberOfBatches:(RSDBMessage*) dbMessage withFlushQueueSize: (int) queueSize;
+ (NSMutableArray<NSString *>*) getBatch:(NSMutableArray<NSString *>*) messageDetails withQueueSize: (int) queueSize;
+ (BOOL) isValidURL:(NSURL*) url;
+ (NSString*) appendSlashToUrl:(NSString*) url;

extern unsigned int MAX_EVENT_SIZE;
extern unsigned int MAX_BATCH_SIZE;
Expand Down
12 changes: 6 additions & 6 deletions Sources/Classes/RSConfigBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (instancetype) withEndPointUrl:(NSString *) endPointUrl{
}
NSURL *url = [[NSURL alloc] initWithString:endPointUrl];
if([RSUtils isValidURL:url]) {
config.dataPlaneUrl = url.absoluteString;
config.dataPlaneUrl = [RSUtils appendSlashToUrl: url.absoluteString];
}
return self;
}
Expand All @@ -31,7 +31,7 @@ - (instancetype) withDataPlaneUrl: (NSString*) dataPlaneUrl {

NSURL *url = [[NSURL alloc] initWithString:dataPlaneUrl];
if([RSUtils isValidURL:url]) {
config.dataPlaneUrl = url.absoluteString;
config.dataPlaneUrl = [RSUtils appendSlashToUrl: url.absoluteString];
}
return self;
}
Expand All @@ -41,7 +41,7 @@ - (instancetype)withDataPlaneURL:(NSURL *) dataPlaneURL {
config = [[RSConfig alloc] init];
}
if([RSUtils isValidURL:dataPlaneURL]) {
config.dataPlaneUrl = dataPlaneURL.absoluteString;
config.dataPlaneUrl = [RSUtils appendSlashToUrl: dataPlaneURL.absoluteString];
}
return self;
}
Expand Down Expand Up @@ -142,7 +142,7 @@ -(instancetype)withConfigPlaneUrl:(NSString *) configPlaneUrl {
}
NSURL *url = [[NSURL alloc] initWithString:configPlaneUrl];
if([RSUtils isValidURL:url]) {
config.controlPlaneUrl = url.absoluteString;
config.controlPlaneUrl = [RSUtils appendSlashToUrl: url.absoluteString];
}
return self;
}
Expand All @@ -153,7 +153,7 @@ - (instancetype)withControlPlaneUrl:(NSString *) controlPlaneUrl {
}
NSURL *url = [[NSURL alloc] initWithString:controlPlaneUrl];
if([RSUtils isValidURL:url]) {
config.controlPlaneUrl = url.absoluteString;
config.controlPlaneUrl = [RSUtils appendSlashToUrl: url.absoluteString];
}
return self;
}
Expand All @@ -163,7 +163,7 @@ - (instancetype)withControlPlaneURL:(NSURL *) controlPlaneURL {
config = [[RSConfig alloc] init];
}
if([RSUtils isValidURL:controlPlaneURL]) {
config.controlPlaneUrl = controlPlaneURL.absoluteString;
config.controlPlaneUrl = [RSUtils appendSlashToUrl: controlPlaneURL.absoluteString];
}
return self;
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/Classes/RSConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
@implementation RSConstants

int const RSConfigRefreshInterval = 2;
NSString *const RSDataPlaneUrl = @"https://hosted.rudderlabs.com";
NSString *const RSDataPlaneUrl = @"https://hosted.rudderlabs.com/";
int const RSFlushQueueSize = 30;
int const RSDBCountThreshold = 10000;
int const RSSleepTimeout = 10;
NSString *const RSControlPlaneUrl = @"https://api.rudderlabs.com";
NSString *const RSControlPlaneUrl = @"https://api.rudderlabs.com/";
bool const RSTrackLifeCycleEvents = YES;
bool const RSRecordScreenViews = NO;
bool const RSEnableBackgroundMode = NO;
NSString *const RS_VERSION = @"1.6.1";
NSString *const RS_VERSION = @"1.6.2";
NSString* const DISABLE = @"disable";
NSString* const WHITELISTED_EVENTS = @"whitelistedEvents";
NSString* const BLACKLISTED_EVENTS = @"blacklistedEvents";
Expand Down
2 changes: 1 addition & 1 deletion Sources/Classes/RSEventRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ - (int) __flushEventsToServer: (NSString*) payload {
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

int __block respStatus = NETWORKSUCCESS;
NSString *dataPlaneEndPoint = [self->config.dataPlaneUrl stringByAppendingString:@"/v1/batch"];
NSString *dataPlaneEndPoint = [self->config.dataPlaneUrl stringByAppendingString:@"v1/batch"];
[RSLogger logDebug:[[NSString alloc] initWithFormat:@"endPointToFlush %@", dataPlaneEndPoint]];

NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:dataPlaneEndPoint]];
Expand Down
7 changes: 1 addition & 6 deletions Sources/Classes/RSServerConfigManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,7 @@ - (NSString *)_networkRequest {
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

__block NSString *responseStr = nil;
NSString *controlPlaneEndPoint = nil;
if([_rudderConfig.controlPlaneUrl hasSuffix:@"/"]) {
controlPlaneEndPoint= [NSString stringWithFormat:@"%@sourceConfig?p=ios&v=%@", _rudderConfig.controlPlaneUrl, RS_VERSION];
} else {
controlPlaneEndPoint= [NSString stringWithFormat:@"%@/sourceConfig?p=ios&v=%@", _rudderConfig.controlPlaneUrl, RS_VERSION];
}
NSString *controlPlaneEndPoint = [NSString stringWithFormat:@"%@sourceConfig?p=ios&v=%@", _rudderConfig.controlPlaneUrl, RS_VERSION];
[RSLogger logDebug:[[NSString alloc] initWithFormat:@"configUrl: %@", controlPlaneEndPoint]];
NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:controlPlaneEndPoint]];
NSData *authData = [[[NSString alloc] initWithFormat:@"%@:", _writeKey] dataUsingEncoding:NSUTF8StringEncoding];
Expand Down
7 changes: 7 additions & 0 deletions Sources/Classes/RSUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ + (BOOL) isValidURL:(NSURL*) url {
return url && [url scheme] && [url host];
}

+ (NSString*) appendSlashToUrl:(NSString*) url {
if([url hasSuffix:@"/"]){
return url;
}
return [url stringByAppendingString:@"/"];
}

unsigned int MAX_EVENT_SIZE = 32 * 1024; // 32 KB
unsigned int MAX_BATCH_SIZE = 500 * 1024; // 500 KB

Expand Down

0 comments on commit 69615f7

Please sign in to comment.