Skip to content

Enable back button through document capture#9292

Merged
matthinz merged 28 commits intomainfrom
matthinz/11041-early-back-button
Oct 18, 2023
Merged

Enable back button through document capture#9292
matthinz merged 28 commits intomainfrom
matthinz/11041-early-back-button

Conversation

@matthinz
Copy link
Contributor

@matthinz matthinz commented Sep 29, 2023

🎫 Tickets

LG-11041
LG-11220
LG-11218

🛠 Summary of changes

Enables the use of the browser back button for early steps of the IdV flow including:

  • Welcome
  • Agreement
  • Hybrid handoff (+ Link sent)
  • Document capture

To do this, the PR updates how early IdV steps evaluate whether the user can access them. Instead of checking whether e.g. the Welcome step has already been visited, we now check whether the user has completed document capture.

There is also a tweak to how the agreement step uses Idv::ConsentForm so that the consent checkbox stays checked when navigating back to it.

The user can navigate freely among the first few steps of the flow as long as they have not submitted DocumentCapture.

  • If they choose UploadPhotos at HybridHandoff, they can click the browser back button from standard DocumentCapture and go back to HybridHandoff or prior steps.
  • If they choose Send Link at HybridHandoff, they are sent a link to complete DocumentCapture on a mobile device and are shown LinkSent, which initiates polling to wait for DocumentCapture to be complete on mobile. The user can click the browser back button (not the back link on the page) and go forward again and polling restarts when they use the forward button to return to Link Sent. When they return to Link Sent, it will pick up a completed DocumentCapture and proceed to the Ssn step.
  • If the user clicks Link Sent again instead of using the browser forward button, and submits the previous DocumentCapture page on mobile it does seem to work. I think it probably uses the same DocumentCaptureSession for subsequent links. I got surprise-rate limited the first time I tried it (since I'm doing a bunch of testing), and I think it rate limited me on what should have been a successful attempt (but that's separate from this branch).

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Begin IdV. Practice going back and forward between the welcome, agreement, and hybrid handoff steps
  • Proceed through document capture to the SSN screen
  • Go back to the welcome step and confirm you are redirected back to the SSN screen

@matthinz matthinz force-pushed the matthinz/11041-early-back-button branch 2 times, most recently from de70372 to d34a937 Compare October 4, 2023 20:18
@matthinz matthinz marked this pull request as ready for review October 4, 2023 21:09
@matthinz matthinz requested a review from a team October 4, 2023 21:09
@soniaconnolly
Copy link
Contributor

Trying this out. Going back and forth between HybridHandoff, Agreement, and Welcome works as described. The Agreement box stays checked after I submit Agreement. 🎉 If I check the Agreement box but don't submit and go back to Welcome and then go forward again, it is unchecked, which is surprising as a user but makes some sense as a developer.

Since your comment says we prevent people from going back once they submit DocumentCapture, I tried submitting HybridHandoff, but not uploading any documents on DocumentCapture, and then going back. HybridHandoff automatically redirects to DocumentCapture, but I can go back past that to Agreement. I think we need to edit the HybridHandoff before_actions in this PR too.

The Agreement before_action needs editing similar to the Welcome one - I was able to go back from Ssn page to Agreement. I was also able to go back from Phone to Welcome, as already noted in a comment.

@matthinz matthinz force-pushed the matthinz/11041-early-back-button branch from 1cd0804 to 9863fab Compare October 6, 2023 20:31
@matthinz
Copy link
Contributor Author

matthinz commented Oct 6, 2023

Current plan is to hold on landing this until hybrid handoff back button situation is resolved (see LG-11218).

matthinz and others added 17 commits October 10, 2023 16:57
changelog: User-Facing Improvements, Identity verification, Enable browser back button for early idv steps
- Keep consent checkbox checked on back
- Clear consent checkbox after re-submitting welcome
Reviewed this with the team and there was a desire to keep this box checked after the user had checked it.
Co-authored-by Matt Hinz <matt.hinz@gsa.gov>
Once verify info is completed, all steps before and including it should be inaccessible
Since we don't have back button for hybrid_handoff worked out yet, don't allow users to go back
to agreement or welcome once they submit hybrid_handoff.
This reverts commit 6ee321689ea3d555c6f60b9424ef810b9974c3cb.
soniaconnolly and others added 2 commits October 10, 2023 16:59
It turns out that polling continues if you go back from LinkSent and return, so it's safe to enable
the back button for hybrid handoff.

Co-authored-by: Doug Price <douglas.price@gsa.gov>
@soniaconnolly soniaconnolly force-pushed the matthinz/11041-early-back-button branch from 375e298 to 4e8e344 Compare October 11, 2023 00:00
@soniaconnolly soniaconnolly requested review from a team and jmhooper October 11, 2023 23:15
@soniaconnolly
Copy link
Contributor

Current plan is to hold on landing this until hybrid handoff back button situation is resolved (see LG-11218).

@solipet and I added code to handle hybrid handoff.

@matthinz matthinz changed the title LG-11041: Enable back button for welcome/agreement LG-11041/LG-11218: Enable back button for welcome/agreement/hybrid handoff Oct 16, 2023
@matthinz matthinz changed the title LG-11041/LG-11218: Enable back button for welcome/agreement/hybrid handoff Enable back button for welcome/agreement/hybrid handoff Oct 16, 2023
@matthinz matthinz changed the title Enable back button for welcome/agreement/hybrid handoff Enable back button through document capture Oct 16, 2023
Copy link
Contributor

@jmhooper jmhooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@matthinz
Copy link
Contributor Author

(I'm gonna write a spec to catch the issue Zach described before landing this.)

matthinz and others added 2 commits October 18, 2023 13:30
Add spec to cover the issue Zach identified with `redirect_to && return`
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@matthinz matthinz force-pushed the matthinz/11041-early-back-button branch from 9e72483 to 20b2411 Compare October 18, 2023 20:31
Copy link
Contributor

@soniaconnolly soniaconnolly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with style comments.

Fewer lets, less indirection, all that good stuff.
@matthinz matthinz merged commit a40a973 into main Oct 18, 2023
@matthinz matthinz deleted the matthinz/11041-early-back-button branch October 18, 2023 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants