Skip to content

Commit

Permalink
Update reseting MSID telemetry logic to make sure reset happens corre…
Browse files Browse the repository at this point in the history
…ctly when in no error cases. Previous accumulated errors should be sent through a successful session
  • Loading branch information
Kai Song authored and Kai Song committed Feb 24, 2025
1 parent 9726576 commit d79b3cf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,10 @@ - (void)handleError:(nullable NSError *)error
context:(id<MSIDRequestContext>)context
{
if (error == nil) {
MSID_LOG_WITH_CTX(MSIDLogLevelError, context, @"Failed to handle telemetry. Error is nil");
return;
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, context, @"Error is nil, reset MSID telemetry");
}

NSString *errorString = [error msidServerTelemetryErrorString];

[self handleError:error
errorString:errorString
context:context];
}

- (void)handleError:(nullable NSError *)error
errorString:(NSString *)errorString
context:(id<MSIDRequestContext>)context
{
if (error == nil) {
MSID_LOG_WITH_CTX(MSIDLogLevelError, context, @"Failed to handle telemetry. Error is nil");
return;
}

[self.lastRequestTelemetry updateWithApiId:self.currentRequestTelemetry.apiId
errorString:errorString
context:context];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ NS_ASSUME_NONNULL_BEGIN
- (void)handleError:(nullable NSError *)error
context:(id<MSIDRequestContext>)context;

- (void)handleError:(nullable NSError *)error
errorString:(NSString *)errorString
context:(id<MSIDRequestContext>)context;

- (void)setTelemetryToRequest:(id<MSIDHttpRequestProtocol>)request;

@end
Expand Down

0 comments on commit d79b3cf

Please sign in to comment.