LG-14749 Cancel enrollments on profile encryption error#11585
LG-14749 Cancel enrollments on profile encryption error#11585shanechesnutt-ft merged 1 commit intomainfrom
Conversation
b973f02 to
f4160db
Compare
f4160db to
153aee8
Compare
app/models/profile.rb
Outdated
There was a problem hiding this comment.
Would there be any harm in doing the canceling of the enrollment in the background job? Like when we go to check on the status of the enrollment, notice the profile is deactivated, and deactivate the enrollment. If the profile is out of sync with the enrollment in the time between when the profile is deactivated and we next check on the enrollment, is that bad?
There was a problem hiding this comment.
There is logic in place that handles cancelling enrollments with profiles that are deactivated in the background job. The issue with it is that users are able to attempt to schedule an enrollment before the pending enrollment is cancelled because of the 30 min / 1 hour window of the background job. If it doesn't make sense to cancel it at the point of encryption error, maybe it would be better to have a check during the ID-IPP workflow to cancel any existing pending enrollments like we do with existing establishing enrollments.
There was a problem hiding this comment.
The profile and in-person enrollment models are tightly coupled which is why I thought it is important that we try to keep them in sync. So when one becomes in a dead state the other should also be in a dead state.
There was a problem hiding this comment.
Gotcha, that makes sense to me
bfc165f to
d8e8d66
Compare
|
Testing Notes
|
6df2218 to
8506ef1
Compare
n1zyy
left a comment
There was a problem hiding this comment.
I'm not sure what it means to approve a draft PR, but this all looks good to me!
There was a problem hiding this comment.
Irrelevant mumblings: my brain always reads this as though it means be_somewhat, like be_kind_of(:confusing) or such. It obviously doesn't make any sense that that would be a matcher, though.
I was going to comment that I prefer be_a_kind_of which reads much better, but in searching the code, be_kind_of is much more common so we should stick with it. (It's kind_of(:a_bummer) though.)
There was a problem hiding this comment.
👏 for adding tests for this class!
There was a problem hiding this comment.
👏 for adding thorough tests to this class that previously had none. 😃
There was a problem hiding this comment.
| context 'when the active profile was activated before the pending profile as created' do | |
| context 'when the active profile was activated before the pending profile was created' do |
Is that how this is supposed to read?
There was a problem hiding this comment.
Nice catch! I will update that!
matthinz
left a comment
There was a problem hiding this comment.
Ok, we had a little back and forth about whether or not to clear in_person_proofing_verification_at when canceling. Where we ended up was to keep the timestamp in place so that we're consistent with what we do in other cases when we cancel profiles.
This all LGTM, with the caveat I haven't actually tested it--I'll leave the IPP portions to y'all.
4f68c6a to
054139f
Compare
eileen-nava
left a comment
There was a problem hiding this comment.
Hi, as I noted in slack here, I am not clear on the benefit of leaving the in_person_verification_pending_at timestamp populated. The main stated benefit seems to be that leaving the timestamp populated indicates what kind of profile it was before cancellation. However, that information is already available from the idv_level field.
I am still approving the PR. That being said, I’d appreciate clarity from Ada Engineering on the benefit of leaving the in_person_verification_pending_at timestamp populated. Thanks!
P.S. Shane, great work adding tests! 👏🏻
054139f to
04d7b87
Compare
changelog: Internal, In-person Proofing, Cancel in-person enrollments when profiles are deactivated due to encryption error.
04d7b87 to
a4d9f5e
Compare
🎫 Ticket
Link to the relevant ticket:
LG-14748
🛠 Summary of changes
Cancel in-person enrollments when a profile is deactivated with reason
encryption_error.📜 Testing Plan
Scenario: User has a pending in-person enrollment and resets their password
cancelled.