Skip to content
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

[GYR1-678] Clients who log in to GYR get stuck in a loop answering demographic questions #5593

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

spompea-cfa
Copy link
Contributor

@spompea-cfa spompea-cfa commented Feb 14, 2025

Link to Jira issue

Is PM acceptance required?

  • Yes - don't merge until JIRA issue is accepted!

Reminder: merge main into this branch and get green tests before merging to main

What was done?

Summary of problem to address: when a client logs back in later, they get stuck
in a loop of having to fill out the demographics questions over and over (which
are asked after the "Success!" page). They never are able to get to a screen
that lets them upload docs (the whole point of logging back in later).

Initial review of the business logic:

  • First, note that the 3 required docs appear to be Id, selfie, and secondary ID
    (e.g., SSN card). I base this on the logic in the already-existing
    has_all_required_doc? method that was in
    app/controllers/documents/ssn_itins_controller.rb (and which I refactored
    into a new lib).
  • I spent some time understanding the GYR documents flow (within the overall
    intake flow), both examining code and experimenting with the app running
    locally, to get a sense of intake flow behavior when the client reaches the
    "Success!" page with versus without having uploaded the required docs.
  • Seems like the issue is that, if no required docs get uploaded, the state will
    always be intake_in_progress and there's no logic in the demographics
    screens etc to change that. Additonally, somehow flow logic will always
    'bookmark' their intake as being at the start of the demographics questions,
    no matter if they've already filled/skipped them or not.

Based on the above:

  • I refactored some code into a new GyrDocuments lib.
  • In app/controllers/questions/successfully_submitted_controller.rb, I added
    logic to transition the intake to a new state (either intake_ready or
    intake_needs_doc_help); this was basically the same logic inside
    app/controllers/documents/ssn_itins_controller.rb but here I put it inside a
    before_action method (whereas in the latter controller it happens in
    after_update_succes).

It seemed like there is some nuance around how the transition logic works. The
changes I made here seem like just enough to solve the problem without affecting
anything else.

How to test?

Using Flow Explorer, test with uploading docs:

  • Go all the way through the flow, and upload a (random) file for all 3 of id,
    selfie, and seconary id, up to the "Success!" page. Then over in the Hub, the
    newly created client should have a status (upper right hand corner) of Ready.

Using Flow Explorer, test by skipping the required doc uploads:

  • Create another client, this time skipping all 3 of those documents. When you
    get to the "Success!" page, you can try either going on through the
    demographics page, or not (either way, the next behaviors should work the
    same; wouldn't hurt to try this both ways).
    • Important: Go to the Hub, confirm this client has a status of Needs Doc
      Help.

    • Now, If you're running locally:

      • go to a terminal and run bin/rails jobs:work.

      • Also, in a Rails console, you might need to do the following (you'll have
        to figure out the right ID):

          Intake.find(14).update!({primary_consented_to_service: "yes"})
        
    • Then go home screen, click "Already started". Enter in the email address.

    • If you're using a heroku/other instance, use whatever method is in place to
      check emails and grab the 6-digit code.

    • If you're running locally, pop back over to your jobs:work tail, and scroll
      up to find that 6-digit code in the output.

    • After inputting the 6-digit code, you should land in the portal screen. The
      button should say "Add missing documents" and when you click that, it should
      take you to the "Here's a list of your documents." page.

    • This last bit of behavior was already in place, but it's worth testing it
      again to be safe: Go through the process here of uploading the 3 requried
      docs. Then in the Hub, the client should now have a status of Intake Ready.

Copy link

Heroku app: https://gyr-review-app-5593-c244d8b6d770.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5593 (optionally add --tail)

@spompea-cfa spompea-cfa force-pushed the gyr1-678-stuck-loop-answering-demographic-questions branch 2 times, most recently from 5448eb5 to 3b12f9b Compare February 20, 2025 22:40
@spompea-cfa spompea-cfa changed the title [wip] [GYR1-678] Clients who log in to GYR get stuck in a loop answering demographic questions [GYR1-678] Clients who log in to GYR get stuck in a loop answering demographic questions Feb 21, 2025
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.

1 participant