-
Notifications
You must be signed in to change notification settings - Fork 66
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
5708 vet360 linking #12866
5708 vet360 linking #12866
Conversation
Generated by 🚫 Danger |
@@ -299,7 +299,7 @@ | |||
VCR.use_cassette('mobile/payment_information/payment_information') do | |||
VCR.use_cassette('mobile/user/get_facilities') do | |||
VCR.use_cassette('mobile/va_profile/demographics/demographics') do | |||
get '/mobile/v0/user', headers: iam_headers |
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.
These are not related to the PR. They were mistakes that were made when creating the v1 of this spec.
{ user_uuid: uuid, transaction_id: result.transaction_id }) | ||
result = VAProfile::Person::Service.new(user).init_vet360_id | ||
Rails.logger.info('Mobile Vet360 account linking request succeeded for user with uuid', | ||
{ user_uuid: uuid, transaction_id: result.transaction.id }) |
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.
I don't think there's any value in this transaction id. One thing that may not be very clear from the diff is that this transaction is different from the transaction that was previously being returned. Neither of them is valuable unless we want to dig deeply into logs with the VAProfile team.
I spent quite a bit of time trying to understand exactly why we were doing this linking and what impact it has. It's not clear from the code and I eventually had to ask Alastair for context (see comment above for Alastair's insight). If you follow the pre-existing code all the way through, what it actually does is make a request to create a VAProfile acount, which creates a response object that has a transaction id that we use to create a transaction record. Then we repeatedly poll the service asking if the transaction succeeded. But this is an async job so there's no reason to repeatedly poll for success. We didn't retry if it failed anyhow. And there's no reason to create the transaction record because it's only used for the purpose of checking back for success. All transaction records are deleted after a month and are not used anywhere else in the app.
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.
LGTM.
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.
👌
* 5708: reduce performance impact of vet360 linking
Summary
This ticket fixes two issues.
Because of these two issues, when the upstream is down, we could see multiple jobs stack up per user and occupy sidekiq threads for nearly a minute each, which puts a lot of unnecessary strain on sidekiq.
Another notable side-effect of this change is that now the linking will happen on both IAM and SIS requests. Previously, these requests were only happening on IAM sessions because no one knew what the linking did so we didn't bother reproducing it for SIS. The fact that this will potentially happen more is a good thing because some mobile app features don't work without a VA Profile account, which the linking job attempts to create for users who don't have them. So this should result in a better mobile app experience for some users.
Related issue(s)
department-of-veterans-affairs/va-mobile-app#5708
Testing done
Specs
Screenshots
What areas of the site does it impact?
Acceptance criteria
Requested Feedback
Any and all.