-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/better error handling #261
base: main
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍(Review updated until commit d22c8c7)Here are some key observations to aid the review process:
|
Generated by 🚫 Danger Swift against 4ed768b |
PR Code Suggestions ✨Latest suggestions up to d22c8c7
Previous suggestionsSuggestions up to commit 046089a
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Persistent review updated to latest commit d22c8c7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JNdhlovu please fix the linter issues. Otherwise code-wise it looks fine to me. I've tested:
- SmartSelfie Enrollment
- SmartSelfie Authentication
- Document Verification - I always get an
unknown error
at the end of the flow even though the verification passes - https://portal.usesmileid.com/admin/002/job_results/production/0000177020
I couldn't test the following, since I don't have the relevant document types:
- Enhanced Document Verification
- Enhanced KYC
- Biometric KYC
@@ -9,7 +9,7 @@ public class LocalStorage { | |||
private static let previewImageName = "PreviewImage.jpg" | |||
private static let jsonEncoder = JSONEncoder() | |||
private static let jsonDecoder = JSONDecoder() | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JNdhlovu you'll have to remove all those tab whitespaces otherwise the linter will complain.
let selfiePath = getRelativePath(from: selfieFile) { | ||
let livenessFiles = livenessFiles, | ||
let selfiePath = getRelativePath(from: selfieFile) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace
)
@@ -329,8 +256,26 @@ extension IOrchestratedDocumentVerificationViewModel: SmartSelfieResultDelegate | |||
|
|||
// swiftlint:disable opening_brace | |||
class OrchestratedDocumentVerificationViewModel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon
)
LocalStorage.getFileByType(jobId: jobId, fileType: .selfie), | ||
LocalStorage.getFileByType(jobId: jobId, fileType: .documentFront), | ||
LocalStorage.getFileByType(jobId: jobId, fileType: .documentBack), | ||
LocalStorage.getInfoJsonFile(jobId: jobId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Collection literals should not have trailing commas. (trailing_comma
)
/// Creates the synchronous result for the job submission | ||
/// - Parameter result: Optional API response | ||
/// - Returns: Success result object | ||
public func createSynchronousResult(result _: ApiResponse?) async throws -> SmileIDResult<ResultType>.Success<ResultType> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Line should be 120 characters or less: currently 127 characters (line_length
)
/// Creates the success result for the job submission | ||
/// - Parameter didSubmit: Whether the job was submitted to the backend | ||
/// - Returns: Success result object | ||
override public func createSuccessResult(didSubmit: Bool) async throws -> SmileIDResult<ResultType>.Success<ResultType> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Line should be 120 characters or less: currently 125 characters (line_length
)
// Created by Japhet Ndhlovu on 12/5/24. | ||
// | ||
|
||
public class EnhancedDocumentVerificationSubmission: BaseDocumentVerificationSubmission<EnhancedDocumentVerificationResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Line should be 120 characters or less: currently 125 characters (line_length
)
public struct SelfieCaptureResult: CommonCaptureData { | ||
public let selfieImage: URL | ||
public let livenessImages: [URL]? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Lines should not have trailing whitespace. (trailing_whitespace
)
public let livenessImages: [URL]? | ||
public let frontImage: URL | ||
public let backImage: URL? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Lines should not have trailing whitespace. (trailing_whitespace
)
return response | ||
} | ||
|
||
override public func createSynchronousResult(result: SmartSelfieResponse?) async throws -> SmileIDResult<SmartSelfieResult>.Success<SmartSelfieResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Line should be 120 characters or less: currently 156 characters (line_length
)
@@ -223,7 +222,7 @@ public class SelfieViewModel: ObservableObject, ARKitSmileDelegate { | |||
DispatchQueue.main.async { | |||
self.directive = | |||
userNeedsToSmile | |||
? "Instructions.Smile" : "Instructions.Capturing" | |||
? "Instructions.Smile" : "Instructions.Capturing" | |||
} | |||
|
|||
// TODO: Use mouth deformation as an alternate signal for non-ARKit capture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ TODOs should be resolved (Use mouth deformation as an al...). (todo
)
Story: https://app.shortcut.com/smileid/story/13730/improve-error-handling-on-android-and-ios-sdk
Improve Error Handling on android and ios sdk.
Summary
Better abstraction for
Known Issues
n/a
Test Instructions
Screenshot
n/a