LG-6777 capture native camera after failed twice#6727
Conversation
-- What We are saving progress, but still trying to figure out where to inject the faile attempts check in order to trigger manual camera/upload flow.
-- What For clarity in the FailedCaptureContext interface, we've added a property called `forceNativeCamera` which is a boolean value that will update in the FailedCaptureContextProvider whenever the maxAttemptsBeforeNativeCamera is equal to or exceeds the current failedCaptures value. Additionally, we finally have some working tests for this. For the moment, we only get results by forcing maxAttemptsBeforeNativeCamera to be 0, then clicking the file input. This seems to do the trick. But we need to figure out how to test a couple of other scenarios, and how to force failures from that point in a test case.
changelog: Improvements, Acuant, updating max attempts before login
-- What This commit updates various JSDoc type annotations so that they accurately describe the new structure of the FailedCaptureAttempts context. Specifically, we added maxAttemptsBeforeNativeCamera and forceNativeCamera to this context in previous commits. Now the types and provider components accurately reflect those changes.
-- What Adding a test to ensure that logging is *not* called in the case where failed attempts is not equal or greater to the max attempts before native camera is forced. changelog: Improvements, Acuant Camera settings, updating max failures before native camera is triggered
solipet
left a comment
There was a problem hiding this comment.
Looks good - I'm going to try and test it locally, but that will wait until Monday...
| addPageAction(`IdV: Force native camera. Failed attempts: ${failedCaptureAttempts}`, { | ||
| field: name, | ||
| }); |
There was a problem hiding this comment.
Since addPageAction logs to the event.log, the name passed should be constant and the failed attempts should go in the data hash that will be logged with it.
| addPageAction(`IdV: Force native camera. Failed attempts: ${failedCaptureAttempts}`, { | |
| field: name, | |
| }); | |
| addPageAction('IdV: Force native camera.', { | |
| field: name, | |
| failed_attempts: $(failedCaptureAttempts), | |
| }); |
There was a problem hiding this comment.
Should we also allowlist this event? see EVENT_MAP for methods on AnalyticsEvents
- so it doesn't need to get prefixed with "frontend"
- so we can get documentation for it?
There was a problem hiding this comment.
I think we should probably leave out the period as well in the suggested change, for consistency with other events?
There was a problem hiding this comment.
Going to work on this now. What are the arguments passed to these ruby-side logging methods in AnalyticsEvents -- are they just the same as the dict/object we pass as the second arg to addPageAction on the frontend?
There was a problem hiding this comment.
Going to work on this now. What are the arguments passed to these ruby-side logging methods in AnalyticsEvents -- are they just the same as the dict/object we pass as the second arg to
addPageActionon the frontend?
Yeah, the properties we add in the JavaScript object here will be passed through as keyword arguments to the corresponding Ruby method.
There was a problem hiding this comment.
Ok I believe I've dealt with this in 1b78fed and subsequent commits
changelog: Improvements, Acuant native camera, linting fixes
-- What We were not correctly calling `addPageAction` when trying to log the force native camera event from the frontend. Additionally, we are adding a method to the frontend log controller for this action so that it can have appropriate documentation. changelog: Improvement, Logging, loggin force native camera event
changelog: Improvements, Testing, removing unused features from tests
-- What After updating the IdV logging string for forcing native camera, we neede to also change the assumption of the tests that check for that string changelog: Improvements, Frontend Testing, fixing logging tests for failed capture
changelog: Improvements, Lintinf fixes, fixing linting in ruby analytics
| * @prop {number} maxFailedAttemptsBeforeTips | ||
| * @prop {number} maxAttemptsBeforeNativeCamera |
There was a problem hiding this comment.
Will a user ever see these tips anymore? If not, is this a feature we'd want to remove?
There was a problem hiding this comment.
@aduth good catch -- we are currently all discussing this and will get back to you / push changes if needed.
There was a problem hiding this comment.
Ok. We have decided to open a separate ticket for dealing with the tips issue. It's going to take us a bit more time to sort that all out. As it stands with this branch, the tips should never be triggered (the default is 3 failed attempts vs our 2).
|
Question: since we have added a configurable yaml setting ( |
No, as long as it's either in the top-level or |
This pull request will force native camera to do the document capture after the sdk camera has failed twice.