-
Notifications
You must be signed in to change notification settings - Fork 0
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
[CCAP-661][CCAP-698] Handle incorrect confirmation code on landing screen followup work #1229
Conversation
submissionRepositoryService.save(dummyFamilySubmission); | ||
|
||
dummyFamilySubmission = submissionRepositoryService.save(dummyFamilySubmission); |
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.
lol this literally wasted 3 hours of my life, as I struggled to figure out why the family submission id was magically being removed from the session. oops.
@@ -40,6 +41,7 @@ void setUp() { | |||
submission.setId(UUID.randomUUID()); | |||
} | |||
|
|||
@Ignore |
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.
Tired of this test failing more often than not on Github, so commenting it out until we have time to investigate further. Hopefully next week I can find the time!
if (("/").equals(refererUri.getPath())) { | ||
newSession.setAttribute(SESSION_KEY_CAME_FROM_HOME_PAGE, true); | ||
} | ||
} |
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.
Just grab the referrer (infamously misspelled) from the request header. If it's the root of the application, we know it's the homepage. If someone clicked a link, it shouldn't be set at all.
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.
Could this live in a helper method cameFromHomePage(Referer referer)
?
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.
Good call, I make a little helper method!
submissionRepositoryService.save(providerSubmission); | ||
providerSubmission.getInputData().put("clientResponseChildren", | ||
ProviderSubmissionUtilities.getChildrenDataForProviderResponse(familySubmission.get())); | ||
submissionRepositoryService.save(providerSubmission); | ||
} |
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 all just reformatting of the code. I was in it while debugging, no actual code changes here.
@@ -40,6 +41,7 @@ void setUp() { | |||
submission.setId(UUID.randomUUID()); | |||
} | |||
|
|||
@Disabled |
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 test keeps failing intermittently on Github runs. Skipping it for now, and hopefully we can find time in the next week to make the test more reliable.
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 had one small comment. I will test this on heroku but the code looks great. π
if (referer != null) { | ||
URI refererUri = new URI(referer); | ||
if (("/").equals(refererUri.getPath())) { | ||
newSession.setAttribute(SESSION_KEY_CAME_FROM_HOME_PAGE, true); |
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.
cool so this is only set when it was a valid confirmation code
@@ -525,6 +525,8 @@ flow: | |||
beforeSaveAction: ConnectProviderApplicationToFamilyApplication | |||
onPostAction: GenerateDummyFamilySubmissionForDev | |||
nextScreens: | |||
- name: response | |||
condition: ShouldSkipConfirmationCode | |||
- name: confirmation-code | |||
confirmation-code: | |||
crossFieldValidationAction: ValidateConfirmationCodeAndSaveId |
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.
My only concern is whether any if these actions are important for an application: ValidateConfirmationCodeAndSaveId or CheckFamilySubmissionForProvider
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.
Great question and valid concern! I dug into those yesterday to make sure I wasn't missing something obvious.
ValidateConfirmationCodeAndSaveId
validates that the confirmation code was valid and not expired, etc but we already know that it's good to go because the initial intake of the code from the homepage will already have validated it. It also saves the familySubmissionId to the provider submission, that happens as well when the Provider enters their id number with ConnectProviderApplicationToFamilyApplication
-- and because the provider can't change the confirmation code from family submission A to family submission B now, because we're not showing the screen to enter the confirmation code, there's no risk of us joining the wrong family submission to the provider submission in this scenario.
CheckFamilySubmissionForProvider
is a similar scenario -- we run this action on the initial intake of the confirmation code, either via a link or now from the homepage input. We have to run it again if we allow the provider to enter a confirmation code because they might have entered/used the link for family A... and then they could change it to family B... but since we're now skipping the screen, the provider won't be able to cause chaos in that manner.
So, we should be good here. I walked through the flow and it seemed to all work for me, the tests all pass, etc. Staring at this yesterday and today, walking through it with the debugger, I feel pretty confident in the above two paragraphs π
Tested in Heroku. Works Great! |
β¦CCAP-661 (#1230) Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
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.
Thanks for fixing these
π Jira ticket
https://codeforamerica.atlassian.net/browse/CCAP-661
https://codeforamerica.atlassian.net/browse/CCAP-698
βοΈ Description
π· Design reference
β Completion tasks