Skip to content

Commit

Permalink
chore(release): pulling release/1.23.1 into master
Browse files Browse the repository at this point in the history
Merge pull request #413 from rudderlabs/release/1.23.1
  • Loading branch information
1abhishekpandey authored Nov 14, 2023
2 parents 29be8d6 + 383a515 commit 50281f0
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 37 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.23.1](https://github.com/rudderlabs/rudder-sdk-ios/compare/v1.23.0...v1.23.1) (2023-11-14)


### Bug Fixes

* update lastActiveTimestamp value when reset call is made ([#412](https://github.com/rudderlabs/rudder-sdk-ios/issues/412)) ([6f229ad](https://github.com/rudderlabs/rudder-sdk-ios/commit/6f229adb89c9a2f347c99cbc99324f07d241d2ae))

## [1.23.0](https://github.com/rudderlabs/rudder-sdk-ios/compare/v1.22.0...v1.23.0) (2023-10-09)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[builder withRecordScreenViews:YES];
[builder withDataPlaneUrl:rudderConfig.DEV_DATA_PLANE_URL];
[builder withControlPlaneUrl:rudderConfig.DEV_CONTROL_PLANE_URL];
[builder withSleepTimeOut:3000];
[builder withDBEncryption:[[RSDBEncryption alloc] initWithKey:@"test1234" enable:NO databaseProvider:[EncryptedDatabaseProvider new]]];
[RSClient getInstance:rudderConfig.WRITE_KEY config:[builder build]];
}
Expand Down
6 changes: 3 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PODS:
- RSCrashReporter (= 1.0.0)
- RudderKit (= 1.4.0)
- RSCrashReporter (1.0.0)
- Rudder (1.20.0):
- Rudder (1.23.0):
- MetricsReporter (= 1.1.1)
- RudderKit (1.4.0)
- SQLCipher (4.5.4):
Expand Down Expand Up @@ -33,10 +33,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
MetricsReporter: d4265e0ac833e2c0078bbe044b3f9dbe29f53a48
RSCrashReporter: 7e26b51ac816e967acb58fa458040946a93a9e65
Rudder: d9e8730c891325da05ac4c454db09bc449d3b9ff
Rudder: 125d9dc03e178b35b0f74487aa694afe1a8e6f4f
RudderKit: d9d6997696e1642b753d8bdf94e57af643a68f03
SQLCipher: 905b145f65f349f26da9e60a19901ad24adcd381

PODFILE CHECKSUM: b6937cee06e0633464427ff0d975d40e17419e9f

COCOAPODS: 1.13.0
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.23.0&color=blue&style=flat">
<img src="https://img.shields.io/static/v1?label=pod&message=v1.23.1&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.23.0'
pod 'Rudder', '1.23.1'
```

### Carthage

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

```xcode
github "rudderlabs/rudder-sdk-ios" "v1.23.0"
github "rudderlabs/rudder-sdk-ios" "v1.23.1"
```

> 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 (`[email protected]:rudderlabs/rudder-sdk-ios.git`) in the search bar.

* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.23.0` as the value, as shown:
* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.23.1` 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: "[email protected]:rudderlabs/rudder-sdk-ios.git", from: "1.23.0")
.package(url: "[email protected]:rudderlabs/rudder-sdk-ios.git", from: "1.23.1")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
8 changes: 4 additions & 4 deletions Sources/Classes/Headers/Public/RSPreferenceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern NSString *const RSOptStatus;
extern NSString *const RSOptInTimeKey;
extern NSString *const RSOptOutTimeKey;
extern NSString *const RSSessionIdKey;
extern NSString *const RSLastEventTimeStamp;
extern NSString *const RSLastActiveTimestamp;
extern NSString *const RSSessionAutoTrackStatus;

+ (instancetype) getInstance;
Expand Down Expand Up @@ -73,9 +73,9 @@ extern NSString *const RSSessionAutoTrackStatus;
- (NSNumber * __nullable) getSessionId;
- (void) clearSessionId;

- (void) saveLastEventTimeStamp: (NSNumber *) lastEventTimeStamp;
- (NSNumber * __nullable) getLastEventTimeStamp;
- (void) clearLastEventTimeStamp;
- (void) saveLastActiveTimestamp: (NSNumber *) lastActiveTimestamp;
- (NSNumber * __nullable) getLastActiveTimestamp;
- (void) clearLastActiveTimestamp;

- (void) saveAutoTrackingStatus: (BOOL) autoTrackingStatus;
- (BOOL) getAutoTrackingStatus;
Expand Down
4 changes: 2 additions & 2 deletions Sources/Classes/Headers/Public/RSUserSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
long sessionInActivityTimeOut;
NSNumber *sessionId;
BOOL sessionStart;
NSNumber *lastEventTimeStamp;
NSNumber *lastActiveTimestamp;
RSPreferenceManager* preferenceManager;
}

Expand All @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)startSessionIfExpired;
- (void)refreshSession;
- (void)clearSession;
- (void)updateLastEventTimeStamp;
- (void)updateLastActiveTimestamp;
- (NSNumber * __nullable)getSessionId;
- (BOOL)getSessionStart;

Expand Down
2 changes: 1 addition & 1 deletion Sources/Classes/Headers/RSVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#ifndef RSVersion_h
#define RSVersion_h

NSString *const SDK_VERSION = @"1.23.0";
NSString *const SDK_VERSION = @"1.23.1";

#endif /* RSVersion_h */
5 changes: 4 additions & 1 deletion Sources/Classes/RSEventRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,17 @@ - (void)applySession:(RSMessage *)message withUserSession:(RSUserSession *)_user
[message setSessionData: _userSession];
}
if(rudderConfig.trackLifecycleEvents && rudderConfig.automaticSessionTracking) {
[_userSession updateLastEventTimeStamp];
[_userSession updateLastActiveTimestamp];
}
}

-(void) reset {
if([self->userSession getSessionId] != nil) {
[RSLogger logDebug: @"EventRepository: reset: Refreshing the session as the reset is triggered"];
[self->userSession refreshSession];
if(self->config.trackLifecycleEvents && self->config.automaticSessionTracking) {
[self->userSession updateLastActiveTimestamp];
}
}

[RSLogger logDebug: @"EventRepository: reset: clearing the CTS Auth token as the reset is triggered"];
Expand Down
18 changes: 9 additions & 9 deletions Sources/Classes/RSPreferenceManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ @implementation RSPreferenceManager
NSString *const RSOptInTimeKey = @"rl_opt_in_time";
NSString *const RSOptOutTimeKey = @"rl_opt_out_time";
NSString *const RSSessionIdKey = @"rl_session_id";
NSString *const RSLastEventTimeStamp = @"rl_last_event_time_stamp";
NSString *const RSLastActiveTimestamp = @"rl_last_event_time_stamp";
NSString *const RSSessionAutoTrackStatus = @"rl_session_auto_track_status";
NSString *const RSEventDeletionStatus = @"rl_event_deletion_status";

Expand Down Expand Up @@ -238,21 +238,21 @@ - (void) clearSessionId {
[[NSUserDefaults standardUserDefaults] synchronize];
}

- (void) saveLastEventTimeStamp:(NSNumber *) lastEventTimeStamp {
[[NSUserDefaults standardUserDefaults] setValue:lastEventTimeStamp forKey:RSLastEventTimeStamp];
- (void) saveLastActiveTimestamp:(NSNumber *) lastActiveTimestamp {
[[NSUserDefaults standardUserDefaults] setValue:lastActiveTimestamp forKey:RSLastActiveTimestamp];
[[NSUserDefaults standardUserDefaults] synchronize];
}

- (NSNumber * __nullable) getLastEventTimeStamp {
NSNumber *lastEventTimeStamp = [[NSUserDefaults standardUserDefaults] valueForKey:RSLastEventTimeStamp];
if(lastEventTimeStamp == nil) {
- (NSNumber * __nullable) getLastActiveTimestamp {
NSNumber *lastActiveTimestamp = [[NSUserDefaults standardUserDefaults] valueForKey:RSLastActiveTimestamp];
if(lastActiveTimestamp == nil) {
return nil;
}
return lastEventTimeStamp;
return lastActiveTimestamp;
}

- (void) clearLastEventTimeStamp {
[[NSUserDefaults standardUserDefaults] setValue:nil forKey:RSLastEventTimeStamp];
- (void) clearLastActiveTimestamp {
[[NSUserDefaults standardUserDefaults] setValue:nil forKey:RSLastActiveTimestamp];
[[NSUserDefaults standardUserDefaults] synchronize];
}

Expand Down
16 changes: 8 additions & 8 deletions Sources/Classes/RSUserSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (instancetype) init:(long)sessionInActivityTimeOut with:(RSPreferenceManager *
self->sessionInActivityTimeOut = sessionInActivityTimeOut;
self->preferenceManager = preferenceManager;
self->sessionId = [self->preferenceManager getSessionId];
self->lastEventTimeStamp = [self->preferenceManager getLastEventTimeStamp];
self->lastActiveTimestamp = [self->preferenceManager getLastActiveTimestamp];
}
return self;
}
Expand Down Expand Up @@ -61,11 +61,11 @@ - (void) startSessionIfExpired {
}

- (BOOL) isSessionExpired {
if(self->lastEventTimeStamp == nil)
if(self->lastActiveTimestamp == nil)
return YES;
__block NSTimeInterval timeDifference;
dispatch_sync(queue, ^{
timeDifference = labs([RSUtils getTimeStampLong] - [self->lastEventTimeStamp longValue]);
timeDifference = labs([RSUtils getTimeStampLong] - [self->lastActiveTimestamp longValue]);
});
if (timeDifference > (self->sessionInActivityTimeOut / 1000)) {
return YES;
Expand All @@ -83,9 +83,9 @@ - (void) clearSession {
dispatch_sync(queue, ^{
self->sessionId = nil;
self->sessionStart = NO;
self->lastEventTimeStamp = nil;
self->lastActiveTimestamp = nil;
[self->preferenceManager clearSessionId];
[self->preferenceManager clearLastEventTimeStamp];
[self->preferenceManager clearLastActiveTimestamp];
});
}

Expand Down Expand Up @@ -113,10 +113,10 @@ - (void) setSessionStart:(BOOL)sessionStart {
});
}

- (void) updateLastEventTimeStamp {
- (void) updateLastActiveTimestamp {
dispatch_sync(queue, ^{
self->lastEventTimeStamp = [[NSNumber alloc] initWithLong:[RSUtils getTimeStampLong]];
[self->preferenceManager saveLastEventTimeStamp:lastEventTimeStamp];
self->lastActiveTimestamp = [[NSNumber alloc] initWithLong:[RSUtils getTimeStampLong]];
[self->preferenceManager saveLastActiveTimestamp:lastActiveTimestamp];
});
}
@end
2 changes: 1 addition & 1 deletion Tests/ContextTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ContextTests: XCTestCase {
preferenceManager.clearTraits()
preferenceManager.clearExternalIds()
preferenceManager.clearSessionId()
preferenceManager.clearLastEventTimeStamp()
preferenceManager.clearLastActiveTimestamp()
preferenceManager.saveAnonymousId("testAnonymousId")
context = RSContext(config: RSConfig())
testUtils = TestUtils()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.23.0",
"version": "1.23.1",
"description": "Rudder is a platform for collecting, storing and routing customer event data to dozens of tools"
}
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sonar.qualitygate.wait=false
sonar.projectKey=rudderlabs_rudder-sdk-ios
sonar.organization=rudderlabs
sonar.projectName=RudderStack iOS SDK
sonar.projectVersion=1.23.0
sonar.projectVersion=1.23.1

# C/C++/Objective-C related details
# sonar.cfamily.compile-commands=compile_commands.json
Expand Down

0 comments on commit 50281f0

Please sign in to comment.