Skip to content

Record IAL2 proofing components (LG-5324)#5721

Merged
zachmargolis merged 5 commits intomainfrom
margolis-assign-proofing-components
Dec 20, 2021
Merged

Record IAL2 proofing components (LG-5324)#5721
zachmargolis merged 5 commits intomainfrom
margolis-assign-proofing-components

Conversation

@zachmargolis
Copy link
Contributor

@zachmargolis zachmargolis commented Dec 16, 2021

(this is a PR with just a failing test, I was having some problems running this locally so I wanted to see the result in CI)

@zachmargolis zachmargolis force-pushed the margolis-assign-proofing-components branch from 9a614d8 to 83430f8 Compare December 20, 2021 20:04
@zachmargolis zachmargolis marked this pull request as ready for review December 20, 2021 20:04
Comment on lines +47 to +48
expect(proofing_components['document_check']).to be_present
expect(proofing_components['document_type']).to be_present
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the bug that triggered this ticket was that the liveness_required wasn't being recorded, so it would make sense to just include that assertion here

however, a lot of the step helpers to get this done aren't set up for js: true and so we'd need to add in extra expect(page).to have_path('/something', wait: 5) in a bunch of random places, was unsure if it was worth it

def update_analytics(client_response)
add_costs(client_response)
update_funnel(client_response)
save_proofing_components
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this approach and this does seem to fit in what I might consider "analytics", but as an alternative, I notice that in other places we add proofing components, it's at the time where we call extract_pii_from_doc. By calling it in the step when we handle the stored result, we could avoid having to reimplement save_proofing_components, and maybe even refactor a bit to combine parts of post_images_and_handle_result and handle_stored_result.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And actually, looking at this code, I wonder if this implementation could cause duplicate proofing components to be added if it's handled both by the hybrid-mobile API call, and then also by the hybrid-desktop's redirect?

def handle_document_verification_success(get_results_response)
save_proofing_components
extract_pii_from_doc(get_results_response)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So proofing components is a misleading name, there's a unique index so a user only has one proofing_component row at a time, so updating in place with the same data should be ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So proofing components is a misleading name, there's a unique index so a user only has one proofing_component row at a time, so updating in place with the same data should be ok?

Ah, okay. I didn't dig too deep, but had seen in the changes below that we "add" (Db::ProofingComponent::Add) a proofing component, so it wasn't immediately obvious if uniqueness was considered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I just broke out this PR to clean that up, take a quick look and it might explain some of the model more: #5737

But to your original point, yes I'll look at seeing if I can re-implement it in the step to avoid duplication

Copy link
Contributor Author

@zachmargolis zachmargolis Dec 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much simpler in 820ae85 ! thanks for the reminder

@zachmargolis zachmargolis merged commit a508aae into main Dec 20, 2021
@zachmargolis zachmargolis deleted the margolis-assign-proofing-components branch December 20, 2021 21:26
jmhooper pushed a commit that referenced this pull request Dec 28, 2021
* Save proofing components in synchronous upload via JS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants