Skip to content

Fix 500 during proofing verify step when expected information is not present#6118

Merged
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/fix-verify-500
Mar 29, 2022
Merged

Fix 500 during proofing verify step when expected information is not present#6118
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/fix-verify-500

Conversation

@mitchellhenke
Copy link
Contributor

We had a few errors in New Relic

I suspect there may be other paths to get into this state, but I was able to reproduce with:

  1. Start proofing process, and proceed up to the resolution/verify step
  2. Open the page in another tab
  3. Click "Start over" in one of the tabs
  4. In the other tab, click "Continue", and the server will 500

It's likely an uncommon path towards a 500, but the result is:

image

@aduth
Copy link
Contributor

aduth commented Mar 29, 2022

I kinda wonder if we should be preventing this before it gets to #call. For example, should the before_action here also apply to update? 🤔

before_action :ensure_correct_step, only: :show

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/fix-verify-500 branch from a768936 to c1fdd39 Compare March 29, 2022 18:53
Comment on lines 14 to 17
Copy link
Contributor

Choose a reason for hiding this comment

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

I drafted a comment here but it looks like it was updated / fixed in the meantime. Still, depending if we want a one-liner, could be relevant:


Curious about the || here: Looking at the implementation of mark_step_incomplete, I might assume it returns a truthy value, assuming the corresponding step exists, and never hit the return.

flow_session.delete(klass.to_s)

Wonder if we could make an explicit (nil?) return value from mark_step_incomplete, and write this as:

return mark_step_incomplete(:ssn) if pii_from_doc.nil?

... with added advantage that it's clearer from the start of the line that this is an early return path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a great idea, will give that a go

@mitchellhenke
Copy link
Contributor Author

I kinda wonder if we should be preventing this before it gets to #call. For example, should the before_action here also apply to update? 🤔

before_action :ensure_correct_step, only: :show

This was the other primary option I considered, and could be a better/more comprehensive way to solve, since I discovered it also affects the prior SsnStep. The tricky part is we don't want it applied to all steps, so it is kind of step-specific.

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/fix-verify-500 branch from c1fdd39 to 3ab9860 Compare March 29, 2022 18:59
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe want to ensure that the #call result is empty, to protect in case a future maintainer decides the nil return in mark_step_incomplete is redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, thank you, added

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have one of these specs for ssn_step as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, added new spec file for it

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/fix-verify-500 branch 2 times, most recently from 871e7b5 to 4dd9740 Compare March 29, 2022 19:26
Mitchell Henke added 2 commits March 29, 2022 14:45
changelog: Bug Fixes, Identity Verification, Fix uncommon errors during proofing at the resolution and SSN steps
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.

2 participants