Skip to content
Open
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## XX.XX.XX
* Mitigated an issue where non-queued requests were affected from request timeout settings.

## 25.4.6
* Added the ability to record reserved events.
* Changed default log level from "CLYInternalLogLevelDebug" to "CLYInternalLogLevelVerbose".
Expand Down
2 changes: 1 addition & 1 deletion Countly.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ - (void)startWithConfig:(CountlyConfig *)config
CountlyCommon.sharedInstance.shouldIgnoreTrustCheck = config.shouldIgnoreTrustCheck;
CountlyCommon.sharedInstance.loggerDelegate = config.loggerDelegate;
CountlyCommon.sharedInstance.internalLogLevel = config.internalLogLevel;

config = [self checkAndFixInternalLimitsConfig:config];

if (config.disableSDKBehaviorSettingsUpdates) {
Expand Down
2 changes: 2 additions & 0 deletions CountlyCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ void CountlyPrint(NSString *stringToPrint);

- (NSURLSession *)URLSession;

- (NSURLSession *)ImmediateURLSession;

- (CGSize)getWindowSize;
@end

Expand Down
11 changes: 11 additions & 0 deletions CountlyCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,17 @@ - (NSURLSession *)URLSession
}
}

- (NSURLSession *)ImmediateURLSession
{
NSURLSessionConfiguration *immediateConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
if (CountlyConnectionManager.sharedInstance.URLSessionConfiguration)
{
immediateConfig.HTTPAdditionalHeaders = CountlyConnectionManager.sharedInstance.URLSessionConfiguration.HTTPAdditionalHeaders;
}

return [NSURLSession sessionWithConfiguration:immediateConfig];
}

- (CGSize)getWindowSize {
#if (TARGET_OS_IOS)
UIWindow *window = nil;
Expand Down
3 changes: 2 additions & 1 deletion CountlyContentBuilderInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ - (void)fetchContents {

[self setRequestQueueLockedThreadSafe:YES];

NSURLSessionTask *dataTask = [[NSURLSession sharedSession] dataTaskWithRequest:[self fetchContentsRequest] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSURLSessionTask *dataTask = [[CountlyCommon.sharedInstance ImmediateURLSession] dataTaskWithRequest:[self fetchContentsRequest] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
// IMMEDIATE REQUEST to find them better in search
if (error) {
CLY_LOG_I(@"%s fetch content details failed: [%@]", __FUNCTION__, error);
[self setRequestQueueLockedThreadSafe:NO];
Expand Down
3 changes: 2 additions & 1 deletion CountlyFeedbackWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ - (void)getWidgetData:(void (^)(NSDictionary * __nullable widgetData, NSError *
return;
}

NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:[self dataRequest] completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:[self dataRequest] completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
// IMMEDIATE REQUEST to find them better in search
NSDictionary *widgetData = nil;

if (!error)
Expand Down
6 changes: 4 additions & 2 deletions CountlyFeedbacksInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ - (void)presentRatingWidgetWithID:(NSString *)widgetID closeButtonText:(NSString
return;

NSURLRequest* feedbackWidgetCheckRequest = [self widgetCheckURLRequest:widgetID];
NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:feedbackWidgetCheckRequest completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:feedbackWidgetCheckRequest completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
// IMMEDIATE REQUEST to find them better in search
NSDictionary* widgetInfo = nil;

if (!error)
Expand Down Expand Up @@ -437,8 +438,9 @@ - (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> *feedback
return;
}

NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:[self feedbacksRequest] completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:[self feedbacksRequest] completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
// IMMEDIATE REQUEST to find them better in search
NSDictionary *feedbacksResponse = nil;

if (!error)
Expand Down
3 changes: 2 additions & 1 deletion CountlyHealthTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ - (void)sendHealthCheck {
CLY_LOG_D(@"%s health check status, healthCheckSent: [%d], healthCheckEnabled: [%d]", __FUNCTION__, _healthCheckSent, _healthCheckEnabled);
}

NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:[self healthCheckRequest] completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:[self healthCheckRequest] completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
// IMMEDIATE REQUEST to find them better in search
if (error)
{
CLY_LOG_W(@"%s error while sending health checks error: [%@]", __FUNCTION__, error);
Expand Down
1 change: 1 addition & 0 deletions CountlyNotificationService.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ + (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withConte

[[NSURLSession.sharedSession downloadTaskWithURL:[NSURL URLWithString:attachmentURL] completionHandler:^(NSURL * location, NSURLResponse * response, NSError * error)
{
// IMMEDIATE REQUEST to find them better in search, but uses NSURLSession.sharedSession as it should not be blocked by SDK configurations
if (!error)
{
COUNTLY_EXT_LOG(@"Attachment download completed!");
Expand Down
13 changes: 8 additions & 5 deletions CountlyRemoteConfigInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ - (void)fetchRemoteConfigForKeys:(NSArray *)keys omitKeys:(NSArray *)omitKeys i
return;

NSURLRequest* request = [self remoteConfigRequestForKeys:keys omitKeys:omitKeys isLegacy:isLegacy];
NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
// IMMEDIATE REQUEST to find them better in search
NSDictionary* remoteConfig = nil;

if (!error)
Expand Down Expand Up @@ -496,8 +497,9 @@ - (void)testingDownloadAllVariantsInternal:(void (^)(CLYRequestResult response,
return;

NSURLRequest* request = [self downloadVariantsRequest];
NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
// IMMEDIATE REQUEST to find them better in search
NSMutableDictionary* variants = NSMutableDictionary.new;

if (!error)
Expand Down Expand Up @@ -607,8 +609,9 @@ - (void)testingEnrollIntoVariantInternal:(NSString *)key variantName:(NSString *
}

NSURLRequest* request = [self enrollInVarianRequestForKey:key variantName:variantName];
NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
// IMMEDIATE REQUEST to find them better in search
NSDictionary* variants = nil;
[self clearCachedRemoteConfig];
if (!error)
Expand Down Expand Up @@ -721,9 +724,9 @@ - (void)testingDownloaExperimentInfoInternal:(void (^)(CLYRequestResult response
return;

NSURLRequest* request = [self downloadExperimentInfoRequest];
NSURLSessionTask* task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
NSURLSessionTask* task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:request completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{

// IMMEDIATE REQUEST to find them better in search
NSMutableDictionary<NSString*, CountlyExperimentInformation*> * experiments = NSMutableDictionary.new;

if (!error)
Expand Down
3 changes: 2 additions & 1 deletion CountlyServerConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ - (void)fetchServerConfig:(CountlyConfig *)config
}
};
// Set default values
NSURLSessionTask *task = [CountlyCommon.sharedInstance.URLSession dataTaskWithRequest:[self serverConfigRequest] completionHandler:handler];
NSURLSessionTask *task = [CountlyCommon.sharedInstance.ImmediateURLSession dataTaskWithRequest:[self serverConfigRequest] completionHandler:handler];
// IMMEDIATE REQUEST to find them better in search
[task resume];
}

Expand Down