-
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
Mobile: Remove duplicate appointments reason_code logic #18288
Conversation
This feels like a risky PR. Our request specs don't actually thoroughly test the different types of appointments with the expected reason code parsing, so we're relying on Our appointments request spec needs to be cleaned up, but, outside of that, I'm not sure I added enough here to feel confident. Would love to know if I'm overthinking the risk of this pr |
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 think you should get rid of that unnecessary begin
block, but otherwise this looks good.
I agree with you that this is a little risky because of the weak specs. As I mentioned on requested periods, it isn't clear to me that the new logic matches the old logic. You clearly put more time into investigating it than I did, so I trust you on that.
How confident do you feel that this matches the old behavior? I think if you feel confident, this is good. It doesn't seem likely to cause outright errors but may cause inconsistent data. Obviously you should test it on staging, but even that won't catch data issues unless you find the right data to test.
modules/mobile/app/models/mobile/v0/adapters/vaos_v2_appointment.rb
Outdated
Show resolved
Hide resolved
@@ -258,14 +253,7 @@ def status | |||
end | |||
|
|||
def requested_periods |
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.
This is fine, but this method no longer performs any logic and is fundamentally just an attr_reader and could just be replaced with appointment[:requested_periods]
where the function is used, which is consistent with how other simple appointment attributes are used in this file.
Looking at the appointments service logic, it looks to me like removing this will change functionality. The service uses the requested periods to do a number of things, but I don't see where it overwrites the requested periods with the preferred dates. I don't know if that's a problem or not. (Take what I'm saying here with a grain of salt because I'm sure you looked at this more closely than I did.)
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 agree removing is changing functionality. We seem to look for requested periods in the reason_code whereas the service expects it to exist as an attribute. I'm not sure if that's a big deal or if they did it that way because requested periods no longer exist in the reason code
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.
Confirmed that the change this makes is just swapping the priority of reason code data vs attribute data. Should be good to go
date:, | ||
time: | ||
} | ||
return nil if appointment[:requested_periods].nil? |
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.
Calls 'appointment[:requested_periods]' 2 times - DuplicateMethodCall
date:, | ||
time: | ||
} | ||
return nil if appointment[:requested_periods].nil? |
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.
Performs a nil-check - NilCheck
I'm going to look again with fresh eyes tomorrow to make sure everything looks good. I'm definitely still quite hesitant on this, especially because of how lacking the tests are. It at least won't cause errors like you said so I'm confident it won't break functionality, may just break some data |
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'm going to wait until Monday to merge this to play it safe |
NVM waiting for someone to review this so that they can merge it since we're no longer able to merge our own PRs |
Note: Delete the description statements, complete each step. None are optional, but can be justified as to why they cannot be completed as written. Provide known gaps to testing that may raise the risk of merging to production.
Summary
Reason code text is not being parsed at the appointments service level. This PR remove mobile's processing as it is now taken care of upstream of our adapter
Related issue(s)
department-of-veterans-affairs/va-mobile-app#9414
Testing done
Edited tests to no longer test our logic as the service that parses reason code performs the testing now
Screenshots
Note: Optional
What areas of the site does it impact?
(Describe what parts of the site are impacted andifcode touched other areas)
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?