LG-4944: track whether the user edits their address or not#5484
LG-4944: track whether the user edits their address or not#5484
Conversation
app/forms/idv/address_form.rb
Outdated
There was a problem hiding this comment.
Interesting... this argument wasn't doing anything before?
There was a problem hiding this comment.
Nope and it wasn't even a user, but a hash with a user and previous_params, neither of which were ever accessed. ¯\_(ツ)_/¯
app/forms/idv/address_form.rb
Outdated
There was a problem hiding this comment.
Trying to wrap my head around the second half of this condition: If they're both blank, wouldn't they be equal to each other, thus short-circuit in the first part? Or is this accounting for differences between nil and '' ? If so, could a .to_s in send(key).to_s != @pii[key].to_s work too?
There was a problem hiding this comment.
is params all the keys of PII? or just the address keys?
There was a problem hiding this comment.
I was thinking of accounting for the differences between nil or "" and ' '. nil.to_s is equal to "", but if they happen to accidentally hit a space in the address2 field, this will still catch that.
In 8f754ac I switched this to use unless - removes the negatives in the logic which hopefully makes it easier to grok.
There was a problem hiding this comment.
@zachmargolis - on line 36, an error is raised if any non-address params are included.
There was a problem hiding this comment.
Could we not just use .present? here and simplify that way rather than going the unless route?
Something like:
if send(key) != @pii[key] && (send(key).present? || @pii[key].present?)
I think that's logically equivalent. If new and old aren't the same and at least one of them is present it has been modified.
There was a problem hiding this comment.
@amathews-fs sounds good - updated in fb19708
There was a problem hiding this comment.
I feel like sometimes we have a idv/capture_doc key in here for the hybrid flow? does this always exist?
There was a problem hiding this comment.
This is past the point where the hybrid flow rejoins the regular doc_auth flow so I assume so. I tried it out locally in the hybrid flow and it worked.
fb19708 to
df4a378
Compare
Context: we pre-populate address for identity resolution step (LexisNexis Instant Verify) with the values from Acuant (scanned from ID)
We let users change the address, and this PR adds logging to track which users go through proofing with the scanned address vs an edited address.
The new key
address_editedwill appear in both theIdV: address submittedandIdV: doc auth optional verify_wait submittedevents, i.e., when the user is done with the address editor, and when they submit their name/address/ssn for verification.