From 11d635fdd40d39f6e807bf349fceae4ae1c0aa22 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Mon, 10 Apr 2023 23:34:48 +0530 Subject: [PATCH 01/12] added pageload tracking event --- .../ActionOpenPageHandler.swift | 6 ++- .../MVMCore/LoadHandling/MVMCoreLoadHandler.m | 1 + .../MVMCore/LoadHandling/MVMCoreLoadObject.h | 3 ++ .../MVMCoreLoadRequestOperation.h | 1 + .../MVMCoreLoadRequestOperation.m | 22 ++++++-- .../MVMCore/OtherHandlers/MVMCoreEvent.swift | 54 ++++++++++++++++++- MVMCore/MVMCore/Utility/MVMCoreErrorObject.h | 3 ++ 7 files changed, 85 insertions(+), 5 deletions(-) diff --git a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift index 0267ea4..2a1c4e6 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift @@ -43,6 +43,10 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol { /// Adds client parameters and makes calls performRequest() open func performRequestAddingClientParameters(with requestParameters: MVMCoreRequestParameters, model: ActionOpenPageModel, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws -> MVMCoreLoadRequestOperation? { + let coreLoadRequestOperation = MVMCoreLoadHandler.sharedGlobal()?.loadRequest(requestParameters, dataForPage: additionalData, delegateObject: delegateObject) + if let pageType = requestParameters.pageType, let identifier = coreLoadRequestOperation?.identifier { + MVMCoreLoggingHandler.shared()?.logCoreEvent(.pageStarted(pageType: pageType, requestUUID: identifier)) + } // Adds any client parameters to the request parameters. if let parametersToFetch = model.clientParameters, let fetchedParameters = try await ClientParameterHandler().getClientParameters( @@ -53,7 +57,7 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol { requestParameters.add(fetchedParameters) } try Task.checkCancellation() - return MVMCoreLoadHandler.sharedGlobal()?.loadRequest(requestParameters, dataForPage: additionalData, delegateObject: delegateObject) + return coreLoadRequestOperation } /// Ensures background requests do not have showing errors. diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index a5f65c1..4430e4b 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -114,6 +114,7 @@ error.nativeDrivenErrorScreen = YES; error.silentError = NO; error.messageToDisplay = error.messageToDisplay ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess]; + error.identifier = loadObject.identifier; } return error; } diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h index 1ee321d..13cf571 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h @@ -58,6 +58,9 @@ // The full response json @property (nullable, strong, nonatomic) NSDictionary *responseJSON; +//Unique Identifier for event tracking +@property (nonatomic, nonatomic, nonnull) NSString *identifier; + - (nullable instancetype)initWithPageJSON:(nullable NSDictionary *)pageJSON modulesJSON:(nullable NSDictionary *)modulesJSON requestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegateObject:(nullable DelegateObject *)delegateObject; - (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegateObject:(nullable DelegateObject *)delegateObject; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h index 0afd035..b441019 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h @@ -26,6 +26,7 @@ @property (nullable, nonatomic, readonly) NSString *finalLoadSource; @property (nonatomic) BOOL backgroundLoad; @property (nonatomic, getter=areDependenciesAdded) BOOL dependenciesAdded; +@property (nonnull, nonatomic, readonly) NSString *identifier; /// Legacy flag for if this operation will have an alert to show when finished. @property (nonatomic, readonly) BOOL alertToShow; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index ee714c3..18f9b2c 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -35,6 +35,7 @@ // For temporarily storing any alert to show until we determine it's delegate. @property (nonatomic, readwrite) BOOL alertToShow; @property (strong, nonatomic, nullable) MVMCoreErrorObject *errorForAlertToShow; +@property (nullable, nonatomic, readwrite) NSString *identifier; @end @@ -48,6 +49,7 @@ self.dataForPage = dataForPage; self.delegateObject = delegateObject; self.backgroundLoad = backgroundLoad; + self.identifier = [NSUUID UUID].UUIDString; } return self; } @@ -55,6 +57,7 @@ - (nullable instancetype)initWithLoadObject:(nullable MVMCoreLoadObject *)loadObject backgroundLoad:(BOOL)backgroundLoad { if (self = [self initWithRequestParameters:loadObject.requestParameters dataForPage:loadObject.dataForPage delegateObject:loadObject.delegateObject backgroundLoad:backgroundLoad]) { + loadObject.identifier = self.identifier; self.loadObject = loadObject; } return self; @@ -120,6 +123,7 @@ // No load requested, finish. MVMCoreLoadObject *loadObject = [[MVMCoreLoadObject alloc] initWithRequestParameters:nil dataForPage:self.dataForPage delegateObject:self.delegateObject]; + loadObject.identifier = self.identifier; loadObject.operation = self; [MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:nil]; } else if (self.loadObject) { @@ -155,9 +159,19 @@ [MVMCoreLoadRequestOperation handleLoadObject:loadObject error:nil]; } else { + if(loadObject.requestParameters.pageType) { + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadStartedFor:loadObject.requestParameters.pageType requestUUID:loadObject.identifier requestURL:@"requestURL"]; + } + // Send a new request to the server. [MVMCoreLoadRequestOperation sendRequest:requestForMissingData loadObject:loadObject completionHandler:^(NSDictionary * _Nullable json) { - + + NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0"; + + if(loadObject.requestParameters.pageType && serverProcessTime) { + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:@"requestURL" requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; + } + // Process the data retrieved from the server. [MVMCoreLoadRequestOperation processJSONFromServer:json loadObject:loadObject completionHandler:^(MVMCoreLoadObject * _Nonnull loadObject, MVMCoreErrorObject * _Nullable error) { @@ -226,7 +240,7 @@ if (pageFromCache) { loadObject.pageType = self.requestParameters.pageType; } - + loadObject.identifier = self.identifier; // Store if we loaded from the cache or not. loadObject.pageDataFromCache = (pageFromCache != nil); loadObject.moduleDataFromCache = (modulesFromCache != nil); @@ -292,10 +306,11 @@ // Error json not correct format. MVMCoreErrorObject *errorObject = [[MVMCoreLoadHandler sharedGlobal] errorForLoadObject:loadObject withTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeJSONNotDictionary domain:ErrorDomainSystem]; + errorObject.identifier = loadObject.identifier; [MVMCoreLoadRequestOperation loadAbortedWithError:errorObject loadObject:loadObject]; } } else { - + error.identifier = loadObject.identifier; // Error with the request/response [[MVMCoreLoadHandler sharedGlobal] attachLoadInformation:loadObject toError:error]; [MVMCoreLoadRequestOperation loadAbortedWithError:error loadObject:loadObject]; @@ -748,6 +763,7 @@ // Once displyed, we are finished. [MVMCoreActionUtility displayViewController:viewController forLoadObject:loadObject presentationDelegate:loadObject.operation completionHandler:^{ + NSLog(@"screen appear from displayViewController"); [MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:viewController errorObject:error]; }]; } diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift index 73d8ecc..5adb3fa 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift @@ -82,9 +82,42 @@ public enum MVMCoreEvent { actionId: String ) + case pageStarted( + pageType: String, + requestUUID: String + ) + + case pageLoadStarted( + pageType: String, + requestUUID: String, + requestURL: String + ) + + case pageLoadComplete( + pageType: String, + requestUUID: String, + serverProcessingTime: String, + requestURL: String, + isFromCache: Bool + ) + + case pageProcessingComplete( + pageType: String, + requestUUID: String, + webUrl: String? + ) + + case pageRenderComplete( + pageType: String, + requestUUID: String, + templateName: String?, + controllerName: String + ) + public enum EventType: String { case action case clientParameter + case pageLoad public var notification: Notification.Name { return Notification.Name(rawValue: rawValue) @@ -102,6 +135,7 @@ public enum MVMCoreEvent { case .clientParameterStartFetch: return .clientParameter case .clientParameterTimeout: return .clientParameter case .clientParameterFetchComplete: return .clientParameter + case .pageStarted, .pageLoadStarted, .pageLoadComplete, .pageProcessingComplete, .pageRenderComplete: return .pageLoad } } @@ -123,5 +157,23 @@ extension MVMCoreLoggingHandler { func logCoreEvent(_ event: MVMCoreEvent, at timestamp: Int64 = Date.unixMillisecondsNow()) { recordEvent(event.type.rawValue, attributes: ["timestamp": timestamp, "event": event]) } - +} + +@objc public extension MVMCoreLoggingHandler { + + @objc func logPageLoadStarted(for pageType: String, requestUUID: String, requestURL: String) { + logCoreEvent(.pageLoadStarted(pageType: pageType, requestUUID: requestUUID, requestURL: requestURL)) + } + + @objc func logPageLoadComplete(for pageType: String, serverProcessingTime: String, requestURL: String, requestUUID: String, isFromCache: Bool) { + logCoreEvent(.pageLoadComplete(pageType: pageType, requestUUID: requestUUID, serverProcessingTime: serverProcessingTime, requestURL: requestURL, isFromCache: isFromCache)) + } + + @objc func logPageProcessingComplete(for pageType: String, requestUUID: String, webUrl: String?) { + logCoreEvent(.pageProcessingComplete(pageType: pageType, requestUUID: requestUUID, webUrl: webUrl)) + } + + @objc func logPageRenderComplete(for pageType: String, requestUUID: String, templateName: String?, controllerName: String) { + logCoreEvent(.pageRenderComplete(pageType: pageType, requestUUID: requestUUID, templateName: templateName, controllerName: controllerName)) + } } diff --git a/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h b/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h index 465dc44..c717855 100644 --- a/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h +++ b/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h @@ -28,6 +28,9 @@ @property (nonatomic, assign) NSInteger httpStatusCode; @property (nullable, strong, nonatomic) NSDictionary *serverResponseInfo; +//Unique Identifier for event tracking +@property (nonatomic, nonatomic, nonnull) NSString *identifier; + // For the crash log. @property (nullable, strong, nonatomic) NSDictionary *crashLog; From f93e1866c13d689a40dcf6e2f4e58a8e2500604d Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Tue, 11 Apr 2023 18:28:25 +0530 Subject: [PATCH 02/12] added error msg in pagerender --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 1 - MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 18f9b2c..bf8e69a 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -763,7 +763,6 @@ // Once displyed, we are finished. [MVMCoreActionUtility displayViewController:viewController forLoadObject:loadObject presentationDelegate:loadObject.operation completionHandler:^{ - NSLog(@"screen appear from displayViewController"); [MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:viewController errorObject:error]; }]; } diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift index 5adb3fa..bbcb6cf 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift @@ -111,7 +111,8 @@ public enum MVMCoreEvent { pageType: String, requestUUID: String, templateName: String?, - controllerName: String + controllerName: String, + error: String? ) public enum EventType: String { @@ -173,7 +174,7 @@ extension MVMCoreLoggingHandler { logCoreEvent(.pageProcessingComplete(pageType: pageType, requestUUID: requestUUID, webUrl: webUrl)) } - @objc func logPageRenderComplete(for pageType: String, requestUUID: String, templateName: String?, controllerName: String) { - logCoreEvent(.pageRenderComplete(pageType: pageType, requestUUID: requestUUID, templateName: templateName, controllerName: controllerName)) + @objc func logPageRenderComplete(for pageType: String, requestUUID: String, templateName: String?, controllerName: String, error: String?) { + logCoreEvent(.pageRenderComplete(pageType: pageType, requestUUID: requestUUID, templateName: templateName, controllerName: controllerName, error: error)) } } From 01b14b02e495814b341d575e3222180fa8106892 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Wed, 12 Apr 2023 17:45:40 +0530 Subject: [PATCH 03/12] moved pagestarted event --- .../MVMCore/ActionHandling/ActionOpenPageHandler.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift index 2a1c4e6..59289a3 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift @@ -43,10 +43,6 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol { /// Adds client parameters and makes calls performRequest() open func performRequestAddingClientParameters(with requestParameters: MVMCoreRequestParameters, model: ActionOpenPageModel, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws -> MVMCoreLoadRequestOperation? { - let coreLoadRequestOperation = MVMCoreLoadHandler.sharedGlobal()?.loadRequest(requestParameters, dataForPage: additionalData, delegateObject: delegateObject) - if let pageType = requestParameters.pageType, let identifier = coreLoadRequestOperation?.identifier { - MVMCoreLoggingHandler.shared()?.logCoreEvent(.pageStarted(pageType: pageType, requestUUID: identifier)) - } // Adds any client parameters to the request parameters. if let parametersToFetch = model.clientParameters, let fetchedParameters = try await ClientParameterHandler().getClientParameters( @@ -57,6 +53,10 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol { requestParameters.add(fetchedParameters) } try Task.checkCancellation() + let coreLoadRequestOperation = MVMCoreLoadHandler.sharedGlobal()?.loadRequest(requestParameters, dataForPage: additionalData, delegateObject: delegateObject) + if let pageType = requestParameters.pageType, let identifier = coreLoadRequestOperation?.identifier { + MVMCoreLoggingHandler.shared()?.logCoreEvent(.pageStarted(pageType: pageType, requestUUID: identifier)) + } return coreLoadRequestOperation } From e3cbc7a7cd06e223598e2f31e4d891b71b4f67d2 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Tue, 18 Apr 2023 18:01:43 +0530 Subject: [PATCH 04/12] added backgroundRequest check & addressed reviewcomments --- .../MVMCore/ActionHandling/ActionOpenPageHandler.swift | 8 +++++--- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h | 2 +- .../MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h | 2 +- .../MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 5 ++--- MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift | 4 ++++ 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift index 59289a3..8e1981f 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift @@ -43,6 +43,10 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol { /// Adds client parameters and makes calls performRequest() open func performRequestAddingClientParameters(with requestParameters: MVMCoreRequestParameters, model: ActionOpenPageModel, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws -> MVMCoreLoadRequestOperation? { + let actionUUID = MVMCoreActionHandler.getUUID(additionalData: additionalData) ?? UUID().uuidString + if !requestParameters.backgroundRequest, let pageType = requestParameters.pageType { + MVMCoreLoggingHandler.shared()?.logCoreEvent(.pageStarted(pageType: pageType, requestUUID: actionUUID)) + } // Adds any client parameters to the request parameters. if let parametersToFetch = model.clientParameters, let fetchedParameters = try await ClientParameterHandler().getClientParameters( @@ -54,9 +58,7 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol { } try Task.checkCancellation() let coreLoadRequestOperation = MVMCoreLoadHandler.sharedGlobal()?.loadRequest(requestParameters, dataForPage: additionalData, delegateObject: delegateObject) - if let pageType = requestParameters.pageType, let identifier = coreLoadRequestOperation?.identifier { - MVMCoreLoggingHandler.shared()?.logCoreEvent(.pageStarted(pageType: pageType, requestUUID: identifier)) - } + coreLoadRequestOperation?.identifier = actionUUID return coreLoadRequestOperation } diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h index 13cf571..72875fa 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.h @@ -59,7 +59,7 @@ @property (nullable, strong, nonatomic) NSDictionary *responseJSON; //Unique Identifier for event tracking -@property (nonatomic, nonatomic, nonnull) NSString *identifier; +@property (nullable, strong, nonatomic) NSString *identifier; - (nullable instancetype)initWithPageJSON:(nullable NSDictionary *)pageJSON modulesJSON:(nullable NSDictionary *)modulesJSON requestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegateObject:(nullable DelegateObject *)delegateObject; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h index b441019..cbf775e 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.h @@ -26,7 +26,7 @@ @property (nullable, nonatomic, readonly) NSString *finalLoadSource; @property (nonatomic) BOOL backgroundLoad; @property (nonatomic, getter=areDependenciesAdded) BOOL dependenciesAdded; -@property (nonnull, nonatomic, readonly) NSString *identifier; +@property (nonnull, nonatomic, strong) NSString *identifier; /// Legacy flag for if this operation will have an alert to show when finished. @property (nonatomic, readonly) BOOL alertToShow; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index bf8e69a..59048a8 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -35,7 +35,6 @@ // For temporarily storing any alert to show until we determine it's delegate. @property (nonatomic, readwrite) BOOL alertToShow; @property (strong, nonatomic, nullable) MVMCoreErrorObject *errorForAlertToShow; -@property (nullable, nonatomic, readwrite) NSString *identifier; @end @@ -159,7 +158,7 @@ [MVMCoreLoadRequestOperation handleLoadObject:loadObject error:nil]; } else { - if(loadObject.requestParameters.pageType) { + if(!loadObject.requestParameters.backgroundRequest && loadObject.requestParameters.pageType) { [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadStartedFor:loadObject.requestParameters.pageType requestUUID:loadObject.identifier requestURL:@"requestURL"]; } @@ -168,7 +167,7 @@ NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0"; - if(loadObject.requestParameters.pageType && serverProcessTime) { + if(!loadObject.requestParameters.backgroundRequest && loadObject.requestParameters.pageType && serverProcessTime) { [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:@"requestURL" requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; } diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift index bbcb6cf..3c1d0dd 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift @@ -162,6 +162,10 @@ extension MVMCoreLoggingHandler { @objc public extension MVMCoreLoggingHandler { + @objc func pageStarted(for pageType: String, requestUUID: String) { + logCoreEvent(.pageStarted(pageType: pageType, requestUUID: requestUUID)) + } + @objc func logPageLoadStarted(for pageType: String, requestUUID: String, requestURL: String) { logCoreEvent(.pageLoadStarted(pageType: pageType, requestUUID: requestUUID, requestURL: requestURL)) } From 10db5ff1bab2ac7f67cbdd3c881de74932333efa Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Thu, 20 Apr 2023 16:51:45 +0530 Subject: [PATCH 05/12] addressed review comments --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 59048a8..401eb8b 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -154,11 +154,13 @@ MVMCoreRequestParameters *requestForMissingData = [MVMCoreLoadRequestOperation createRequestForDataWithLoadObject:loadObject]; if (!requestForMissingData) { + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:@"0" requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; + // We have all the needed data, continue with the load. [MVMCoreLoadRequestOperation handleLoadObject:loadObject error:nil]; } else { - if(!loadObject.requestParameters.backgroundRequest && loadObject.requestParameters.pageType) { + if(!self.backgroundLoad && loadObject.requestParameters.pageType) { [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadStartedFor:loadObject.requestParameters.pageType requestUUID:loadObject.identifier requestURL:@"requestURL"]; } @@ -167,7 +169,7 @@ NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0"; - if(!loadObject.requestParameters.backgroundRequest && loadObject.requestParameters.pageType && serverProcessTime) { + if(!self.backgroundLoad && loadObject.requestParameters.pageType && serverProcessTime) { [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:@"requestURL" requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; } From c10cb0792e65a8b9858cb074bb9c48c220113df0 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Mon, 24 Apr 2023 15:43:38 +0530 Subject: [PATCH 06/12] updated request url --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 29dd440..0b72002 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -172,7 +172,7 @@ NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0"; if(!self.backgroundLoad && loadObject.requestParameters.pageType && serverProcessTime) { - [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:@"requestURL" requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:[[loadObject.requestParameters resolveURL:[MVMCoreSessionObject sharedGlobal]] absoluteString] requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; } // Process the data retrieved from the server. From 27f138d6c1b3e4cd277170f5cac4ad303671474f Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Mon, 24 Apr 2023 23:06:17 +0530 Subject: [PATCH 07/12] updated to requestParameters.URL --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 0b72002..4884007 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -172,7 +172,7 @@ NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0"; if(!self.backgroundLoad && loadObject.requestParameters.pageType && serverProcessTime) { - [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:[[loadObject.requestParameters resolveURL:[MVMCoreSessionObject sharedGlobal]] absoluteString] requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; } // Process the data retrieved from the server. From 85f70964996e582780b40c074a35f59ef276bf6b Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Tue, 25 Apr 2023 18:35:18 +0530 Subject: [PATCH 08/12] updated request url --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 4884007..b3cedf5 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -163,7 +163,7 @@ } else { if(!self.backgroundLoad && loadObject.requestParameters.pageType) { - [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadStartedFor:loadObject.requestParameters.pageType requestUUID:loadObject.identifier requestURL:@"requestURL"]; + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadStartedFor:loadObject.requestParameters.pageType requestUUID:loadObject.identifier requestURL:loadObject.requestParameters.URL.absoluteString]; } // Send a new request to the server. From 3d1f1617c5b5aa4c7a92ec562e4c8cc09963d932 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Fri, 28 Apr 2023 21:05:37 +0530 Subject: [PATCH 09/12] added identifier in requestparameters & correlationId --- MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift | 1 + MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m | 2 +- MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m | 3 +++ MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 7 +++---- MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h | 3 +++ MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift | 7 ++++--- MVMCore/MVMCore/Utility/MVMCoreErrorObject.h | 3 --- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift index 8e1981f..ea40b42 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionOpenPageHandler.swift @@ -44,6 +44,7 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol { /// Adds client parameters and makes calls performRequest() open func performRequestAddingClientParameters(with requestParameters: MVMCoreRequestParameters, model: ActionOpenPageModel, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws -> MVMCoreLoadRequestOperation? { let actionUUID = MVMCoreActionHandler.getUUID(additionalData: additionalData) ?? UUID().uuidString + requestParameters.identifier = actionUUID if !requestParameters.backgroundRequest, let pageType = requestParameters.pageType { MVMCoreLoggingHandler.shared()?.logCoreEvent(.pageStarted(pageType: pageType, requestUUID: actionUUID)) } diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index 629f1ab..3e5ae1f 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -114,7 +114,7 @@ error.nativeDrivenErrorScreen = YES; error.silentError = NO; error.messageToDisplay = error.messageToDisplay ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess]; - error.identifier = loadObject.identifier; + error.requestId = loadObject.identifier; //To track for errors due to invalid JSON or any errors thrown at viewcontroller level. } return error; } diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m index 25240c4..3be1428 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadObject.m @@ -55,6 +55,9 @@ if (errorObject.messageToDisplay) { [responseInfo setObject:errorObject.messageToDisplay forKey:KeyUserMessage]; } + if (errorObject.requestId) { + self.identifier = errorObject.requestId; + } self.responseInfoMap = responseInfo; } return self; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index b3cedf5..6c6873e 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -156,7 +156,7 @@ MVMCoreRequestParameters *requestForMissingData = [MVMCoreLoadRequestOperation createRequestForDataWithLoadObject:loadObject]; if (!requestForMissingData) { - [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:@"0" requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:@"0" requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache correlationId: nil]; // We have all the needed data, continue with the load. [MVMCoreLoadRequestOperation handleLoadObject:loadObject error:nil]; @@ -170,9 +170,10 @@ [MVMCoreLoadRequestOperation sendRequest:requestForMissingData loadObject:loadObject completionHandler:^(NSDictionary * _Nullable json) { NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0"; + NSString *correlationId = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"correlationId"]]; if(!self.backgroundLoad && loadObject.requestParameters.pageType && serverProcessTime) { - [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache correlationId:correlationId]; } // Process the data retrieved from the server. @@ -309,11 +310,9 @@ // Error json not correct format. MVMCoreErrorObject *errorObject = [[MVMCoreLoadHandler sharedGlobal] errorForLoadObject:loadObject withTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeJSONNotDictionary domain:ErrorDomainSystem]; - errorObject.identifier = loadObject.identifier; [MVMCoreLoadRequestOperation loadAbortedWithError:errorObject loadObject:loadObject]; } } else { - error.identifier = loadObject.identifier; // Error with the request/response [[MVMCoreLoadHandler sharedGlobal] attachLoadInformation:loadObject toError:error]; [MVMCoreLoadRequestOperation loadAbortedWithError:error loadObject:loadObject]; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h index a2ca9bf..28d7f2d 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h @@ -101,6 +101,9 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { /// A flag for if it should be a background request or not. @property (assign, nonatomic) BOOL backgroundRequest; +//Unique Identifier for event tracking +@property (nullable, strong, nonatomic) NSString *identifier; + // Creates an object with the given page type and extra parameters. Adds the extra parameters to the standard request parameters. Will add any modules needed by the page type by default. - (nullable instancetype)initWithPageType:(nonnull NSString *)pageType extraParameters:(nullable NSDictionary *)extraParameters; diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift index 3c1d0dd..c95158e 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift @@ -98,7 +98,8 @@ public enum MVMCoreEvent { requestUUID: String, serverProcessingTime: String, requestURL: String, - isFromCache: Bool + isFromCache: Bool, + correlationId: String? ) case pageProcessingComplete( @@ -170,8 +171,8 @@ extension MVMCoreLoggingHandler { logCoreEvent(.pageLoadStarted(pageType: pageType, requestUUID: requestUUID, requestURL: requestURL)) } - @objc func logPageLoadComplete(for pageType: String, serverProcessingTime: String, requestURL: String, requestUUID: String, isFromCache: Bool) { - logCoreEvent(.pageLoadComplete(pageType: pageType, requestUUID: requestUUID, serverProcessingTime: serverProcessingTime, requestURL: requestURL, isFromCache: isFromCache)) + @objc func logPageLoadComplete(for pageType: String, serverProcessingTime: String, requestURL: String, requestUUID: String, isFromCache: Bool, correlationId: String?) { + logCoreEvent(.pageLoadComplete(pageType: pageType, requestUUID: requestUUID, serverProcessingTime: serverProcessingTime, requestURL: requestURL, isFromCache: isFromCache, correlationId: correlationId)) } @objc func logPageProcessingComplete(for pageType: String, requestUUID: String, webUrl: String?) { diff --git a/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h b/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h index c717855..465dc44 100644 --- a/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h +++ b/MVMCore/MVMCore/Utility/MVMCoreErrorObject.h @@ -28,9 +28,6 @@ @property (nonatomic, assign) NSInteger httpStatusCode; @property (nullable, strong, nonatomic) NSDictionary *serverResponseInfo; -//Unique Identifier for event tracking -@property (nonatomic, nonatomic, nonnull) NSString *identifier; - // For the crash log. @property (nullable, strong, nonatomic) NSDictionary *crashLog; From 6372fcb56de1185997ae15412a6d787f13026f99 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Tue, 2 May 2023 17:20:05 +0530 Subject: [PATCH 10/12] removed correlationId --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 5 ++--- MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 6c6873e..ffcf1a5 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -156,7 +156,7 @@ MVMCoreRequestParameters *requestForMissingData = [MVMCoreLoadRequestOperation createRequestForDataWithLoadObject:loadObject]; if (!requestForMissingData) { - [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:@"0" requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache correlationId: nil]; + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:@"0" requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; // We have all the needed data, continue with the load. [MVMCoreLoadRequestOperation handleLoadObject:loadObject error:nil]; @@ -170,10 +170,9 @@ [MVMCoreLoadRequestOperation sendRequest:requestForMissingData loadObject:loadObject completionHandler:^(NSDictionary * _Nullable json) { NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0"; - NSString *correlationId = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"correlationId"]]; if(!self.backgroundLoad && loadObject.requestParameters.pageType && serverProcessTime) { - [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache correlationId:correlationId]; + [[MVMCoreLoggingHandler sharedLoggingHandler] logPageLoadCompleteFor:loadObject.requestParameters.pageType serverProcessingTime:serverProcessTime requestURL:loadObject.requestParameters.URL.absoluteString requestUUID:loadObject.identifier isFromCache:loadObject.pageDataFromCache]; } // Process the data retrieved from the server. diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift index c95158e..3c1d0dd 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift @@ -98,8 +98,7 @@ public enum MVMCoreEvent { requestUUID: String, serverProcessingTime: String, requestURL: String, - isFromCache: Bool, - correlationId: String? + isFromCache: Bool ) case pageProcessingComplete( @@ -171,8 +170,8 @@ extension MVMCoreLoggingHandler { logCoreEvent(.pageLoadStarted(pageType: pageType, requestUUID: requestUUID, requestURL: requestURL)) } - @objc func logPageLoadComplete(for pageType: String, serverProcessingTime: String, requestURL: String, requestUUID: String, isFromCache: Bool, correlationId: String?) { - logCoreEvent(.pageLoadComplete(pageType: pageType, requestUUID: requestUUID, serverProcessingTime: serverProcessingTime, requestURL: requestURL, isFromCache: isFromCache, correlationId: correlationId)) + @objc func logPageLoadComplete(for pageType: String, serverProcessingTime: String, requestURL: String, requestUUID: String, isFromCache: Bool) { + logCoreEvent(.pageLoadComplete(pageType: pageType, requestUUID: requestUUID, serverProcessingTime: serverProcessingTime, requestURL: requestURL, isFromCache: isFromCache)) } @objc func logPageProcessingComplete(for pageType: String, requestUUID: String, webUrl: String?) { From e6ca9ec67d9e62430ddf79f8b934414e94c294ec Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Tue, 2 May 2023 20:07:40 +0530 Subject: [PATCH 11/12] Bug fix while setting identifier --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m | 2 ++ MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index 3e5ae1f..64d67ce 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -389,6 +389,7 @@ return [self loadBackgroundRequest:requestParameters dataForPage:dataForPage delegateObject:delegateObject]; } else { MVMCoreLoadRequestOperation *loadOperation = [[MVMCoreLoadRequestOperation alloc] initWithRequestParameters:requestParameters dataForPage:dataForPage delegateObject:delegateObject backgroundLoad:NO]; + loadOperation.identifier = requestParameters.identifier; [self.blockingLoadQueue addOperation:loadOperation]; return loadOperation; } @@ -396,6 +397,7 @@ - (MVMCoreLoadRequestOperation *)loadBackgroundRequest:(nonnull MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegateObject:(nullable DelegateObject *)delegateObject { MVMCoreLoadRequestOperation *loadOperation = [[MVMCoreLoadRequestOperation alloc] initWithRequestParameters:requestParameters dataForPage:dataForPage delegateObject:delegateObject backgroundLoad:YES]; + loadOperation.identifier = requestParameters.identifier; [self.backgroundLoadQueue addOperation:loadOperation]; return loadOperation; } diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index ffcf1a5..931c967 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -48,7 +48,6 @@ self.dataForPage = dataForPage; self.delegateObject = delegateObject; self.backgroundLoad = backgroundLoad; - self.identifier = [NSUUID UUID].UUIDString; } return self; } From 87135f31edfcab4d8aaa51fb2afb4a738610bb00 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Wed, 3 May 2023 22:12:09 +0530 Subject: [PATCH 12/12] added public access specifier --- MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift index 3c1d0dd..8ccae44 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreEvent.swift @@ -153,7 +153,7 @@ public enum MVMCoreEvent { } } -extension MVMCoreLoggingHandler { +public extension MVMCoreLoggingHandler { func logCoreEvent(_ event: MVMCoreEvent, at timestamp: Int64 = Date.unixMillisecondsNow()) { recordEvent(event.type.rawValue, attributes: ["timestamp": timestamp, "event": event])