Compare commits

...

18 Commits

Author SHA1 Message Date
Pfeil, Scott Robert
3e1581e28e Merge branch 'bugfix/prevent_feed_cache_clearing' into 'develop'
Bugfix/prevent feed cache clearing

### Summary
Prevent premature feeds cache clearing.

### JIRA Ticket
https://onejira.verizon.com/browse/MVAPCT-322

Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/351
2024-10-04 18:06:12 +00:00
Hedden, Kyle Matthew
8f2483eb1b Digital PCT265 defect MVAPCT-322: Mesasge to log for modules missing their ResponseInfo. 2024-10-04 12:20:59 -04:00
Hedden, Kyle Matthew
12d17dbca8 Digital PCT265 defect MVAPCT-322: Convert couple more hard coded restarts to be soft. 2024-10-04 12:20:35 -04:00
Pfeil, Scott Robert
c360c75512 Merge branch 'feature/ONEAPP-11359' into 'develop'
Digital ACT192 story ONEAPP-11359: Lift the minimum supported iOS version number to 15.

### Summary
Lift the minimum supported iOS version number to 15.

### JIRA Ticket
https://onejira.verizon.com/browse/ONEAPP-11359

Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/349
2024-10-03 21:23:07 +00:00
Pfeil, Scott Robert
d57a86e140 Merge branch 'bugfix/prevent_feed_cache_clearing' into 'develop'
Digital PCT265 defect: Prevent standard session restarts from clearing the persistent cache.

### Summary
Discovered during Monday's outage, the feed cache is actually getting prematurely cleared on standard session timeouts. Moving logic to be based on the logout action itself.

### JIRA
https://onejira.verizon.com/browse/MVAPCT-322

Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/350
2024-10-03 19:23:07 +00:00
Hedden, Kyle Matthew
214ccfd8f6 Digital PCT265 defect MVAPCT-322: Spelling fix. 2024-10-03 15:15:11 -04:00
Pfeil, Scott Robert
31aa1d6df7 Merge branch 'feature/CXTDT-552152' into 'develop'
CXTDT-552152

### Summary
Potential Fix for Crash in New Relic

### JIRA Ticket
https://onejira.verizon.com/browse/CXTDT-552152

Co-authored-by: Danish Phiroz <danish.phiroz@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/348
2024-10-03 13:29:14 +00:00
Hedden, Kyle Matthew
817d7900f4 Digital PCT265 defect: Prevent standard session restarts from clearing the persistent cache. 2024-10-02 17:45:58 -04:00
Danish Phiroz
4b35a8bb2d PR Review comment fixed 2024-10-02 13:27:33 -04:00
Danish Phiroz
a29fa60e5e PR Review comments fixed 2024-10-02 12:47:26 -04:00
Hedden, Kyle Matthew
3103f8dd89 Digital ACT192 story ONEAPP-11359: Lift the minimum supported iOS version number to 15. 2024-10-01 20:23:42 -04:00
Danish Phiroz
2b36711bca Potential Fix for Crash 2024-10-01 16:08:55 -04:00
Hedden, Kyle Matthew
a570f3c0e6 Merge branch 'feature/action_id_initial_parameters' into 'develop'
Digital ACT191 story ONEAPP-10840 - Passing action id through to initialParameters getter

### Summary
Passing actionId through to initial parameters getter

### JIRA Ticket
https://onejira.verizon.com/browse/ONEAPP-10840

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/347
2024-09-20 18:42:35 +00:00
Scott Pfeil
038fb8cdf7 Digital ACT191 story ONEAPP-10840 - Optimizing, passing in existing actionId variable 2024-09-20 09:54:47 -04:00
Scott Pfeil
dd2b0f9de5 Digital ACT191 story ONEAPP-10840 - Passing action id through to initialParameters getter 2024-09-19 16:27:08 -04:00
Hedden, Kyle Matthew
d61cb6cfb9 Merge branch 'feature/MVAPCT-273' into 'develop'
MVAPCT-273

### Summary
Action decoding failed Error Logs 

### MVAPCT-273
https://onejira.verizon.com/browse/MVAPCT-273

Co-authored-by: Danish Phiroz <danish.phiroz@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/346
2024-09-19 12:30:48 +00:00
Phiroz, Danish
cf3d7810d4 MVAPCT-273 2024-09-19 12:30:48 +00:00
Hedden, Kyle Matthew
3c8af09752 Merge branch 'feature/atomic-vds-new-forms-atoms' into 'develop'
ModelComparisonProtocol addition

### Summary
Appending to existing Protocol for == and !=

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/343
2024-08-22 20:38:56 +00:00
13 changed files with 77 additions and 16 deletions

View File

@ -1113,7 +1113,7 @@
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../../SharedFrameworks";
INFOPLIST_FILE = MVMCore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 3.1;
@ -1140,7 +1140,7 @@
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../../SharedFrameworks";
INFOPLIST_FILE = MVMCore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 3.1;

View File

@ -86,7 +86,7 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol {
let fetchedParameters = await ClientParameterHandler().getClientParameters(
with: parametersToFetch,
requestParameters: requestParameters.parameters as? [String : Any] ?? [:],
actionId: MVMCoreActionHandler.getUUID(additionalData: additionalData) ?? "unknown",
actionId: actionUUID,
showLoadingOverlay: !requestParameters.backgroundRequest) {
requestParameters.add(fetchedParameters)
}

View File

@ -25,11 +25,16 @@ open class ActionRestartHandler: MVMCoreActionHandlerProtocol {
return
}
continuation.resume(throwing: MVMCoreError.errorObject(error))
} else {
// Restarts the app (forcing any passed in page types).
MVMCoreSessionObject.sharedGlobal()?.restartSession(withPageType: model.pageType, request: model.requestURL, parameters: model.extraParameters?.toJSON(), clearAllVariables: true)
continuation.resume()
return
}
if let sessionObject = MVMCoreSessionObject.sharedGlobal() {
if model.hardReset {
sessionObject.clearPersistentCache()
}
// Restarts the app (forcing any passed in page types).
sessionObject.restartSession(withPageType: model.pageType, request: model.requestURL, parameters: model.extraParameters?.toJSON(), clearAllVariables: true)
}
continuation.resume()
})
}
}

View File

@ -16,6 +16,7 @@ public struct ActionRestartModel: ActionModelProtocol {
public static var identifier: String = "restart"
public var actionType: String = ActionRestartModel.identifier
public var requestURL: URL?
@DecodableDefault.True public var hardReset: Bool
public var extraParameters: JSONValueDictionary?
public var analyticsData: JSONValueDictionary?
@ -26,11 +27,12 @@ public struct ActionRestartModel: ActionModelProtocol {
// MARK: - Initializer
//--------------------------------------------------
public init(_ pageType: String? = nil, _ requestUrl: URL? = nil, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
public init(_ pageType: String? = nil, _ requestUrl: URL? = nil, hardReset: Bool? = nil, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
self.pageType = pageType
self.requestURL = requestUrl
self.extraParameters = extraParameters
self.analyticsData = analyticsData
self.hardReset = hardReset ?? true
}
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
@ -39,5 +41,6 @@ public struct ActionRestartModel: ActionModelProtocol {
&& analyticsData == model.analyticsData
&& requestURL == model.requestURL
&& pageType == model.pageType
&& hardReset == model.hardReset
}
}

View File

@ -158,7 +158,7 @@ public protocol MVMCoreJSONActionHandlerProtocol: MVMCoreActionHandlerProtocol {
errorObject.requestUrl = browserUrl
}
if let humanReadableMessage = (error as? HumanReadableDecodingErrorProtocol)?.readableDescription {
errorObject.messageToLog = humanReadableMessage
errorObject.messageToLog = "Failed to decode the \(actionType ?? "") action model. " + humanReadableMessage
}
defaultHandleActionError(errorObject, additionalData: additionalData)
}

View File

@ -52,7 +52,7 @@
- (void)getJsonData:(nonnull MVMCoreRequestParameters *)requestParameters forUrl:(nonnull NSURL *)url completion:(nonnull void (^)(NSData * _Nullable data, MVMCoreErrorObject *_Nullable error))completion;
- (void)getInitialParametersExcludingSections:(NSSet<NSString *> *_Nullable)excludeSections completion:(nonnull void (^)(NSDictionary *_Nullable parameters))completion NS_SWIFT_NAME(initialParameters(excludingSections:completion:));
- (void)getInitialParametersExcludingSections:(NSSet<NSString *> *_Nullable)excludeSections actionId:(nonnull NSString *)actionId completion:(nonnull void (^)(NSDictionary *_Nullable parameters))completion NS_SWIFT_NAME(initialParameters(excludingSections:actionId:completion:));
// Creates a request object with the given parameters.
- (void)transformToRequestWithParameters:(nonnull MVMCoreRequestParameters *)requestParameters completion:(nonnull void (^)(NSURLRequest * _Nullable request, MVMCoreErrorObject *_Nullable error))completion;

View File

@ -190,7 +190,7 @@
}
}
- (void)getInitialParametersExcludingSections:(NSSet<NSString *> *_Nullable)excludeSections completion:(nonnull void (^)(NSDictionary *_Nullable parameters))closure {}
- (void)getInitialParametersExcludingSections:(NSSet<NSString *> *)excludeSections actionId:(NSString *)actionId completion:(void (^)(NSDictionary * _Nullable))completion {}
- (void)getJsonDictionary:(nonnull MVMCoreRequestParameters *)requestParameters completion:(nonnull void (^)(NSDictionary * _Nullable jsonDictionary))completion {
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
@ -206,7 +206,7 @@
}
// Sets up the Initial parameters.
[self getInitialParametersExcludingSections:requestParameters.excludedInitialParameters completion:^(NSDictionary * _Nullable initialParameters) {
[self getInitialParametersExcludingSections:requestParameters.excludedInitialParameters actionId:requestParameters.identifier ?: [NSUUID UUID].UUIDString completion:^(NSDictionary * _Nullable initialParameters) {
if (initialParameters) {
[parameters setObject:initialParameters forKey:@"InitialParams"];
}

View File

@ -686,7 +686,16 @@
if (obj && [obj isKindOfClass:[NSDictionary class]]) {
NSDictionary *responseInfo = [obj dict:KeyResponseInfo];
if (![ValueTypeSuccess isEqualToString:[responseInfo string:KeyType]]) {
//Response Info is missing but errorObject should be created with generic message + code + domain
if (responseInfo == nil) {
errorObject = [[MVMCoreLoadHandler sharedGlobal]
errorForLoadObject:loadObject
withTitle:nil
message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical]
messageToLog:[NSString stringWithFormat:@"Module %@ is missing a %@ object.", key, KeyResponseInfo]
code:ErrorCodeJSONNotDictionary
domain:ErrorDomainServer];
} else if (![ValueTypeSuccess isEqualToString:[responseInfo string:KeyType]]) {
errorObject = [[MVMCoreLoadHandler sharedGlobal] attachLoadInformation:loadObject toError:
[[MVMCoreErrorObject alloc]
initWithTitle:[responseInfo stringForKey:KeyErrorHeading]
@ -696,7 +705,6 @@
domain:ErrorDomainServer
location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]];
}
// Caches each dictionary from the array.
[[MVMCoreCache sharedCache] addModuleToCache:obj module:key queue:nil waitUntilFinished:YES completionBlock:NULL];
} else {

View File

@ -70,9 +70,35 @@ import os
#endif
}
open func handleWarningMessage(_ message: String, category: String?) {
#if LOGGING
guard message.count < 1024 else {
getLogger(category: category).warning("\(message.prefix(300), privacy: .public)... <stdio>") // Send initial log to console.
print(message) // Print the whole on stdout.
return
}
getLogger(category: category).warning("\(message, privacy: .public)") // Assume that becaues this is a LOGGING build we want these messages to be unmasked.
#endif
}
open func handleErrorMessage(_ message: String, category: String?) {
#if LOGGING
guard message.count < 1024 else {
getLogger(category: category).error("\(message.prefix(300), privacy: .public)... <stdio>") // Send initial log to console.
print(message) // Print the whole on stdout.
return
}
getLogger(category: category).error("\(message, privacy: .public)") // Assume that becaues this is a LOGGING build we want these messages to be unmasked.
#endif
}
@objc(addErrorToLog:)
open func addError(toLog errorObject: MVMCoreErrorObject) {
// Subclass to handle.
if errorObject.silentError {
handleWarningMessage(errorObject.messageToLog ?? errorObject.messageToDisplay ?? "Some error occurred.", category: "Handled Exception")
} else {
handleErrorMessage(errorObject.messageToLog ?? errorObject.messageToDisplay ?? "Some error occurred.", category: "Handled Exception")
}
}
open func logLoadFinished(_ loadObject: MVMCoreLoadObject?, loadedViewController: MVMCoreViewControllerProtocol?, error: MVMCoreErrorObject?) {}

View File

@ -38,6 +38,9 @@
/// Clears the session singleton. Creates a new session NSURLSession also.
- (void)clearSessionObject;
/// Clears any persistent cache related to the current session.
- (void)clearPersistentCache;
/// Copys string to clipboard and assigns self.clipboardString for validation
/// Should only be used when expected string is a secure string
-(void)copyStringToClipboard :(nullable NSString *)clipboardString;

View File

@ -53,4 +53,6 @@
self.session = [self createNSURLSession];
}
- (void)clearPersistentCache {}
@end

View File

@ -23,8 +23,10 @@
// Initialization code
self.title = title;
self.messageToDisplay = message;
self.messageToLog = message;
self.code = code;
self.domain = domain;
self.systemDomain = nil;
self.location = location;
self.date = [NSDate date];
self.silentError = YES;
@ -32,6 +34,11 @@
[MVMCoreDispatchUtility performSyncBlockOnMainThread:^{
self.applicationState = [UIApplication sharedApplication].applicationState;
}];
self.sessionId = nil;
self.requestId = nil;
self.requestUrl = nil;
self.serverResponseInfo = nil;
self.crashLog = nil;
}
return self;
}
@ -41,9 +48,11 @@
if (self = [super init]) {
// Initialization code
self.title = title;
self.messageToDisplay = nil;
self.messageToLog = messageToLog;
self.code = code;
self.domain = domain;
self.systemDomain = nil;
self.location = location;
self.date = [NSDate date];
self.silentError = YES;
@ -51,6 +60,11 @@
[MVMCoreDispatchUtility performSyncBlockOnMainThread:^{
self.applicationState = [UIApplication sharedApplication].applicationState;
}];
self.sessionId = nil;
self.requestId = nil;
self.requestUrl = nil;
self.serverResponseInfo = nil;
self.crashLog = nil;
}
return self;
}

View File

@ -30,7 +30,7 @@ extension ModelRegistry.Error: HumanReadableDecodingErrorProtocol {
public var readableDescription: String {
switch (self) {
case .decoderErrorModelNotMapped(let identifier, let codingKey, let codingPath) where identifier != nil && codingKey != nil && codingPath != nil:
return "Model identifier \"\(identifier!)\" is not mapped for \"\(codingKey!.stringValue)\" @ \(codingPath!.map { return $0.stringValue })"
return "Model identifier \"\(identifier!)\" is not mapped for \"\(codingKey!.stringValue)\" @ \(codingPath!.map { return $0.stringValue })"
case .decoderErrorObjectNotPresent(let codingKey, let codingPath):
return "Required model \"\(codingKey.stringValue)\" was not found @ \(codingPath.map { return $0.stringValue })"