From 40741deac35a67b48071a55174461982bc921c55 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 10 Apr 2023 11:50:42 -0400 Subject: [PATCH 1/6] setup biometrics action --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 4 ++++ MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index ee714c3..a75cdb5 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -357,6 +357,10 @@ return; } + if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(modifyJSON:)]) { + jsonDictionary = [[MVMCoreObject sharedInstance].globalLoadDelegate modifyJSON:jsonDictionary]; + } + loadObject.responseJSON = jsonDictionary; // Store the new page data if we didn't load page data from the cache. diff --git a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h index 65ea153..bd2c82d 100644 --- a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h +++ b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h @@ -16,6 +16,8 @@ @optional +- (nonnull NSDictionary *)modifyJSON:(nonnull NSDictionary *)json; + // Provides the desired error screen for the native error. Called on the main thread. If set, any native errors or NSURLErrorDomain errors will use a native screen. - (nullable UIViewController *)getNativeScreenForRequestError:(nonnull MVMCoreErrorObject *)errorObject requestObject:(nonnull MVMCoreRequestParameters *)requestObject; From 53634fcaa13861bd2ecf90628a9915253c98d663 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 15 Jun 2023 12:12:03 -0400 Subject: [PATCH 2/6] ONEAPP-3998: Convenience function to simplify the current objc-swift bridge of having two action protocols. --- MVMCore/MVMCore/ActionHandling/ActionDelegateProtocol.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MVMCore/MVMCore/ActionHandling/ActionDelegateProtocol.swift b/MVMCore/MVMCore/ActionHandling/ActionDelegateProtocol.swift index 6788d08..c927e9a 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionDelegateProtocol.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionDelegateProtocol.swift @@ -19,3 +19,9 @@ public extension ActionDelegateProtocol { try await MVMCoreActionHandler.shared()?.handleAction(with: model, additionalData: additionalData, delegateObject: delegateObject) } } + +public extension MVMCoreActionDelegateProtocol { + func action(with model: ActionModelProtocol, additionalData: [AnyHashable : Any]?, delegateObject: DelegateObject?) async throws { + try await (self as? ActionDelegateProtocol)?.performAction(with: model, additionalData: additionalData, delegateObject: delegateObject) + } +} From 3383d71c1948cbeebf26ffdfa58c535243786963 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 15 Jun 2023 12:16:17 -0400 Subject: [PATCH 3/6] ONEAPP-3998: Allow a chance to override code. --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 3 ++- MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 621a057..012d0ca 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -371,10 +371,11 @@ return; } +#if TESTING if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(modifyJSON:)]) { jsonDictionary = [[MVMCoreObject sharedInstance].globalLoadDelegate modifyJSON:jsonDictionary]; } - +#endif loadObject.responseJSON = jsonDictionary; // Store the new page data if we didn't load page data from the cache. diff --git a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h index bd2c82d..9dc7d78 100644 --- a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h +++ b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h @@ -16,7 +16,10 @@ @optional +#if TESTING +/// Allows a chance to modify the json and provide local test json. - (nonnull NSDictionary *)modifyJSON:(nonnull NSDictionary *)json; +#endif // Provides the desired error screen for the native error. Called on the main thread. If set, any native errors or NSURLErrorDomain errors will use a native screen. - (nullable UIViewController *)getNativeScreenForRequestError:(nonnull MVMCoreErrorObject *)errorObject requestObject:(nonnull MVMCoreRequestParameters *)requestObject; @@ -43,4 +46,6 @@ /// Checks to see if the operation has content to show. - (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error; +- (nonnull NSDictionary *)getJSON:(nonnull NSDictionary *)json; + @end From ce246523acff86a900e771024802db8231514fec Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 20 Jun 2023 16:07:47 -0400 Subject: [PATCH 4/6] remove old test code --- MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h index 9dc7d78..2b66238 100644 --- a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h +++ b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h @@ -46,6 +46,4 @@ /// Checks to see if the operation has content to show. - (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error; -- (nonnull NSDictionary *)getJSON:(nonnull NSDictionary *)json; - @end From 05289f88aaf5379f5231f30ffbde7068bb0e2e90 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 21 Jun 2023 12:11:15 -0400 Subject: [PATCH 5/6] main thread change for session handler --- MVMCore/MVMCore/Singletons/MVMCoreObject.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MVMCore/MVMCore/Singletons/MVMCoreObject.m b/MVMCore/MVMCore/Singletons/MVMCoreObject.m index 2bbeb06..21eb44e 100644 --- a/MVMCore/MVMCore/Singletons/MVMCoreObject.m +++ b/MVMCore/MVMCore/Singletons/MVMCoreObject.m @@ -25,9 +25,7 @@ self.session = [[MVMCoreSessionObject alloc] init]; self.cache = [[MVMCoreCache alloc] init]; self.viewControllerMapping = [[MVMCoreViewControllerMappingObject alloc] init]; - [MVMCoreDispatchUtility performSyncBlockOnMainThread:^{ - self.sessionHandler = [[MVMCoreSessionTimeHandler alloc] init]; - }]; + self.sessionHandler = [[MVMCoreSessionTimeHandler alloc] init]; self.actionHandler = [[MVMCoreActionHandler alloc] init]; self.loggingDelegate = [[MVMCoreLoggingHandler alloc] init]; self.loadHandler = [[MVMCoreLoadHandler alloc] init]; From 25394dc6407ec3a9c6e58ef651abc65c322aade2 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 21 Jun 2023 12:23:59 -0400 Subject: [PATCH 6/6] remove debug code for now --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 5 ----- MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h | 5 ----- 2 files changed, 10 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 012d0ca..dd5b822 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -371,11 +371,6 @@ return; } -#if TESTING - if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(modifyJSON:)]) { - jsonDictionary = [[MVMCoreObject sharedInstance].globalLoadDelegate modifyJSON:jsonDictionary]; - } -#endif loadObject.responseJSON = jsonDictionary; // Store the new page data if we didn't load page data from the cache. diff --git a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h index 2b66238..65ea153 100644 --- a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h +++ b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h @@ -16,11 +16,6 @@ @optional -#if TESTING -/// Allows a chance to modify the json and provide local test json. -- (nonnull NSDictionary *)modifyJSON:(nonnull NSDictionary *)json; -#endif - // Provides the desired error screen for the native error. Called on the main thread. If set, any native errors or NSURLErrorDomain errors will use a native screen. - (nullable UIViewController *)getNativeScreenForRequestError:(nonnull MVMCoreErrorObject *)errorObject requestObject:(nonnull MVMCoreRequestParameters *)requestObject;