Skip to content

Commit

Permalink
Merge pull request #703 from Microsoft/develop
Browse files Browse the repository at this point in the history
Merge develop to master
  • Loading branch information
jaeklim authored Aug 9, 2017
2 parents 31912dc + 32375de commit b4ffc61
Show file tree
Hide file tree
Showing 94 changed files with 1,634 additions and 954 deletions.
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# Mobile Center SDK for iOS Change Log

## Version 0.11.1

This version contains bug fixes and an improvement that changes the current behavior.

## MobileCenter

* **[Fix]** Fix bugs that sent multiple or empty service start logs at launch time.

## MobileCenterAnalytics

* **[Improvement]** Send truncated event name and properties instead of skipping it if its lengths are beyond the limits.

## MobileCenterCrashes

* **[Fix]** Fixes two bugs that caused error logs to be assiciated with wrong session information.
___

## Version 0.11.0

This version has a **breaking change** in the Crashes module and contains other bugfixes and improvements.
This version has a **breaking change** in the Crashes module and contains other bug fixes and improvements.

### MobileCenter

Expand All @@ -21,7 +38,7 @@ ___

## Version 0.10.1

This version contains a bugfix for crash attachments.
This version contains a bug fix for crash attachments.

### MobileCenterCrashes

Expand Down Expand Up @@ -173,7 +190,7 @@ ___

### MobileCenterAnalytics

* **[Bug]** Fix session Id's tOffset matching.
* **[Bug]** Fix session Id's toffset matching.

### MobileCenterCrashes

Expand Down
12 changes: 10 additions & 2 deletions CrashLibIOS/CrashLibIOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,12 @@
B21A71E11DD2A38C0044BB1C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(ARCHS_STANDARD)",
armv7s,
);
CLANG_ANALYZER_NONNULL = YES_NONAGGRESSIVE;
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
Expand Down Expand Up @@ -424,8 +428,12 @@
B21A71E21DD2A38C0044BB1C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(ARCHS_STANDARD)",
armv7s,
);
CLANG_ANALYZER_NONNULL = YES_NONAGGRESSIVE;
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
Expand Down
2 changes: 1 addition & 1 deletion Documentation/MobileCenter/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../Themes/apple

module: MobileCenter
module_version: 0.11.0
module_version: 0.11.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/MobileCenterAnalytics/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../Themes/apple

module: MobileCenterAnalytics
module_version: 0.11.0
module_version: 0.11.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/MobileCenterCrashes/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../Themes/apple

module: Crashes
module_version: 0.11.0
module_version: 0.11.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/MobileCenterDistribute/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../Themes/apple

module: Distribute
module_version: 0.11.0
module_version: 0.11.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/MobileCenterPush/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../Themes/apple

module: MobileCenterPush
module_version: 0.11.0
module_version: 0.11.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Global.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BUILD_NUMBER = 1
VERSION_STRING = 0.11.0
VERSION_STRING = 0.11.1

SDK_NAME = mobilecenter.ios

Expand Down
2 changes: 1 addition & 1 deletion MobileCenter.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MobileCenter'
s.version = '0.11.0'
s.version = '0.11.1'

s.summary = 'Mobile Center is mission control for mobile apps. Get faster release cycles, higher-quality apps, and the insights to build what users want.'
s.description = <<-DESC
Expand Down
21 changes: 13 additions & 8 deletions MobileCenter/MobileCenter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
6EB1F40E1D2443B7005F9F99 /* MSChannelDefaultTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EB1F40D1D2443B7005F9F99 /* MSChannelDefaultTests.m */; };
6EF628F41D371B1600CAFF64 /* MSChannelConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EF628F21D371B1600CAFF64 /* MSChannelConfiguration.h */; };
6EF628F51D371B1600CAFF64 /* MSChannelConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EF628F31D371B1600CAFF64 /* MSChannelConfiguration.m */; };
805F3F6B1F209C9D00B489E4 /* MSMockService.m in Sources */ = {isa = PBXBuildFile; fileRef = 805F3F6A1F209C9D00B489E4 /* MSMockService.m */; };
842C131E1E7FCF5300F16EA3 /* MSUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 842C13151E7FCF5300F16EA3 /* MSUtility.h */; };
842C131F1E7FCF5300F16EA3 /* MSUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 842C13161E7FCF5300F16EA3 /* MSUtility.m */; };
842C13201E7FCF5300F16EA3 /* MSUtility+Application.h in Headers */ = {isa = PBXBuildFile; fileRef = 842C13171E7FCF5300F16EA3 /* MSUtility+Application.h */; };
Expand All @@ -123,8 +124,8 @@
B21E29911E83521A00F9A22D /* MSUtility+StringFormatting.h in Headers */ = {isa = PBXBuildFile; fileRef = B21E298F1E83521A00F9A22D /* MSUtility+StringFormatting.h */; };
B21E29921E83521A00F9A22D /* MSUtility+StringFormatting.m in Sources */ = {isa = PBXBuildFile; fileRef = B21E29901E83521A00F9A22D /* MSUtility+StringFormatting.m */; };
B24F3F171D93A3FF00827213 /* MSLoggerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B24F3F161D93A3FF00827213 /* MSLoggerTests.m */; };
B289FF881F291F9D00AA2E06 /* MSDeviceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3C1831DB83A3E00CB83F7 /* MSDeviceInternal.h */; };
B2B9441E1DF0DF23009117D1 /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2B9441D1DF0DF23009117D1 /* OHHTTPStubs.framework */; };
B2C3C1841DB83A3E00CB83F7 /* MSDeviceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3C1831DB83A3E00CB83F7 /* MSDeviceInternal.h */; };
B2FD53621E56501B0050F909 /* MSDeviceHistoryInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FD53601E56501B0050F909 /* MSDeviceHistoryInfo.h */; };
B2FD53631E56501B0050F909 /* MSDeviceHistoryInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = B2FD53611E56501B0050F909 /* MSDeviceHistoryInfo.m */; };
B2FD53651E567BCF0050F909 /* MSDeviceHistoryInfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2FD53641E567BCF0050F909 /* MSDeviceHistoryInfoTests.m */; };
Expand Down Expand Up @@ -294,6 +295,8 @@
6EB1F40D1D2443B7005F9F99 /* MSChannelDefaultTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MSChannelDefaultTests.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
6EF628F21D371B1600CAFF64 /* MSChannelConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSChannelConfiguration.h; sourceTree = "<group>"; };
6EF628F31D371B1600CAFF64 /* MSChannelConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSChannelConfiguration.m; sourceTree = "<group>"; };
805F3F691F209C8A00B489E4 /* MSMockService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSMockService.h; sourceTree = "<group>"; };
805F3F6A1F209C9D00B489E4 /* MSMockService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSMockService.m; sourceTree = "<group>"; };
842C13151E7FCF5300F16EA3 /* MSUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSUtility.h; sourceTree = "<group>"; };
842C13161E7FCF5300F16EA3 /* MSUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSUtility.m; sourceTree = "<group>"; };
842C13171E7FCF5300F16EA3 /* MSUtility+Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MSUtility+Application.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -344,8 +347,8 @@
E88D17051D35B6B500A5EA57 /* MSMockLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSMockLog.m; sourceTree = "<group>"; };
E88EBBEB1D2C612E007E7785 /* MSAbstractLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSAbstractLog.m; sourceTree = "<group>"; };
E88EBBFA1D2C8CC7007E7785 /* MSLogContainerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MSLogContainerTests.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E8A8D1E91D3057A90022931E /* MSUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MSUserDefaults.h; path = ../Model/Utils/MSUserDefaults.h; sourceTree = "<group>"; };
E8A8D1EA1D3057A90022931E /* MSUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MSUserDefaults.m; path = ../Model/Utils/MSUserDefaults.m; sourceTree = "<group>"; };
E8A8D1E91D3057A90022931E /* MSUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MSUserDefaults.h; path = ../Model/Util/MSUserDefaults.h; sourceTree = "<group>"; };
E8A8D1EA1D3057A90022931E /* MSUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MSUserDefaults.m; path = ../Model/Util/MSUserDefaults.m; sourceTree = "<group>"; };
E8AEE9811D5970A400C0FF6C /* MSLogManagerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSLogManagerDelegate.h; sourceTree = "<group>"; };
E8E48F941D50FF4300A8C1B0 /* MSSenderCallDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSSenderCallDelegate.h; sourceTree = "<group>"; };
F803BBF11E8E3677004B1E7A /* MSCustomProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSCustomProperties.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -506,7 +509,7 @@
045BC3181E3FD8AC00B6C960 /* MSKeychainUtil.h */,
);
name = Util;
path = Utils;
path = Util;
sourceTree = "<group>";
};
6E0401821D1CAD810051BCFA /* Support */ = {
Expand Down Expand Up @@ -632,6 +635,8 @@
3805DDA61EB7A6A6001DB846 /* MSMockOriginalAppDelegate.m */,
3872CA961ECA0B04006B2E3B /* MSMockCustomAppDelegate.h */,
3872CA971ECA0B04006B2E3B /* MSMockCustomAppDelegate.m */,
805F3F691F209C8A00B489E4 /* MSMockService.h */,
805F3F6A1F209C9D00B489E4 /* MSMockService.m */,
);
path = Util;
sourceTree = "<group>";
Expand Down Expand Up @@ -713,7 +718,7 @@
E8753D6D1D4BE53F00241513 /* MSSenderUtil.m */,
);
name = Util;
path = Utils;
path = Util;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -752,9 +757,8 @@
384772A61DA5691F009365DE /* MSSenderDelegate.h in Headers */,
D38023E91E6EFC7C00466558 /* MSStartServiceLog.h in Headers */,
387C76FD1D6C9CF100D68CC1 /* MSServiceAbstract.h in Headers */,
B2C3C1841DB83A3E00CB83F7 /* MSDeviceInternal.h in Headers */,
B289FF881F291F9D00AA2E06 /* MSDeviceInternal.h in Headers */,
383481731EA7FF6100787F56 /* MSLogDBStoragePrivate.h in Headers */,
B2C3C1841DB83A3E00CB83F7 /* MSDeviceInternal.h in Headers */,
B21E29911E83521A00F9A22D /* MSUtility+StringFormatting.h in Headers */,
842C13251E7FCF5300F16EA3 /* MSUtility+Environment.h in Headers */,
6E3E2C9E1D35701000B1EE50 /* MSLog.h in Headers */,
Expand Down Expand Up @@ -841,7 +845,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = MS;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = Microsoft;
TargetAttributes = {
6E0401021D1C98220051BCFA = {
Expand Down Expand Up @@ -980,6 +984,7 @@
380A4DCB1DD6908A00E99219 /* MSUtilityTests.m in Sources */,
3849BA7E1EF3489D0072E3E0 /* MSDBStorageTests.m in Sources */,
E829E4231D25C8BA00F19DA1 /* MSIngestionSenderTests.m in Sources */,
805F3F6B1F209C9D00B489E4 /* MSMockService.m in Sources */,
E88EBBFB1D2C8CC7007E7785 /* MSLogContainerTests.m in Sources */,
04FD126B1E4103CC007ABFE7 /* MSKeychainUtilTests.m in Sources */,
D38024121E7130C700466558 /* MSStartServiceLogTests.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ - (void)flushQueue {
// Remove from pending logs.
[self.pendingBatchIds removeObject:senderBatchId];
[self.storage deleteLogsWithBatchId:senderBatchId groupId:self.configuration.groupId];

// Update pending batch queue state.
if (self.pendingBatchQueueFull &&
self.pendingBatchIds.count < self.configuration.pendingBatchesLimit) {
self.pendingBatchQueueFull = NO;
}
}
} else
MSLogWarning([MSMobileCenter logTag], @"Batch Id %@ not expected, ignore.", senderBatchId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,14 @@ - (void)processLog:(id<MSLog>)log forGroupId:(NSString *)groupId {
[delegate onEnqueuingLog:log withInternalId:internalLogId];
}];

// Set common log info.
log.toffset = [NSNumber numberWithLongLong:(long long)([MSUtility nowInMilliseconds])];

// Only add device info in case the log doesn't have one. In case the log is restored after a crash or for crashes,
// We don't want the device information to be updated but want the old one preserved.
/*
* Set common log info.
* Only add toffset and device info in case the log doesn't have one. In case the log is restored after a crash or for
* crashes, we don't want the toffset and the device information to be updated but want the old one preserved.
*/
if (!log.toffset) {
log.toffset = [NSNumber numberWithLongLong:(long long)([MSUtility nowInMilliseconds])];
}
if (!log.device) {
log.device = [[MSDeviceTracker sharedInstance] device];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "Model/MSLog.h"
#import "Model/MSLogContainer.h"
#import "Model/MSLogWithPropertiesInternal.h"
#import "Model/Utils/MSUserDefaults.h"
#import "Model/Util/MSUserDefaults.h"

// Channel
#import "Channel/MSChannelDelegate.h"
Expand Down
9 changes: 6 additions & 3 deletions MobileCenter/MobileCenter/Internals/Sender/MSSenderCall.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ - (void)sender:(id<MSSender>)sender
callCompletedWithStatus:(NSUInteger)statusCode
data:(NSData *)data
error:(NSError *)error {
if ([MSSenderUtil isNoInternetConnectionError:error]) {
BOOL internetIsDown = [MSSenderUtil isNoInternetConnectionError:error];
BOOL couldNotEstablishSecureConnection = [MSSenderUtil isSSLConnectionError:error];
if (internetIsDown || couldNotEstablishSecureConnection) {

// Reset the retry count, will retry once the connection is established again.
// Reset the retry count, will retry once the (secure) connection is established again.
[self resetRetry];
MSLogInfo([MSMobileCenter logTag], @"Internet connection is down.");
NSString *logMessage = internetIsDown ? @"Internet connection is down." : @"Could not establish secure connection.";
MSLogInfo([MSMobileCenter logTag],logMessage);
[sender suspend];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,21 @@ static NSString *const kMSHidingStringForAppSecret = @"*";
*
* @param error http error.
*
* @return is no network connection error.
* @return YES if it is a no network connection error, NO otherwise.
*/
+ (BOOL)isNoInternetConnectionError:(NSError *)error;

/**
* Indicate if error is because a secure connection could not be established, e.g. when using a public network that
* is open but requires accepting terms and conditions, and the user hasn't done that, yet.
*
* @param error http error.
*
* @return YES if it is an SSL connection error, NO otherwise.
*/
+ (BOOL)isSSLConnectionError:(NSError *)error;

/**
* Indicate if error is due to cancelation of the request.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ + (BOOL)isNoInternetConnectionError:(NSError *)error {
return ([error.domain isEqualToString:NSURLErrorDomain] && (error.code == NSURLErrorNotConnectedToInternet));
}

+ (BOOL)isSSLConnectionError:(NSError *)error {

// Check for error domain and if the error.code falls in the range of SSL connection errors (between -2000 and -1200).
return ([error.domain isEqualToString:NSURLErrorDomain] &&
((error.code >= NSURLErrorCannotLoadFromNetwork) && (error.code <= NSURLErrorSecureConnectionFailed)));
}

+ (BOOL)isRequestCanceledError:(NSError *)error {
return ([error.domain isEqualToString:NSURLErrorDomain] && (error.code == NSURLErrorCancelled));
}
Expand Down
6 changes: 3 additions & 3 deletions MobileCenter/MobileCenter/Internals/Storage/MSDBStorage.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


#import <sqlite3.h>

#import "MSDBStoragePrivate.h"
Expand Down Expand Up @@ -95,7 +95,7 @@ - (BOOL)executeNonSelectionQuery:(NSString *)query {
[[NSString alloc] initWithUTF8String:errMsg]);
}
} else {
MSLogError([MSMobileCenter logTag], @"Failed to open database.");
MSLogError([MSMobileCenter logTag], @"Failed to open database for non-selection query with result: %d.", result);
}
sqlite3_close(db);
return SQLITE_OK == result;
Expand Down Expand Up @@ -144,7 +144,7 @@ - (BOOL)executeNonSelectionQuery:(NSString *)query {
[[NSString alloc] initWithUTF8String:sqlite3_errmsg(db)]);
}
} else {
MSLogError([MSMobileCenter logTag], @"Failed to open database.");
MSLogError([MSMobileCenter logTag], @"Failed to open database for non-selection query with result: %d.", result);
}
sqlite3_close(db);
return entries;
Expand Down
Loading

0 comments on commit b4ffc61

Please sign in to comment.