-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: add guard clause for flow[nodeId] in autoAnswerableOptions #4123
Conversation
Removed vultr server and associated DNS entries |
When resuming, the user returns the most recent published version of their flow, NOT the version they started on/left from. This is handled by what we call a "reconciliation" process. If we let everyone resume to the version of the flow they started from, there wouldn't be a need for reconciliation, but there would be the potential to submit invalid/out-of-date applications if legislation changed over your 28 days. Therefore, it's valid and expected that their may be a breadcrumb which no longer has an associated node in the flow. We have a function |
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 this change is correct (automation tests are all passing), but I am a bit confused re-creating session and want to double check my work against what you all did:
- I've copied the session to this pizza via Hasura console
- I can resume a session here using my OSL email https://4123.planx.pizza/barnet/apply-for-a-lawful-development-certificate/published?analytics=false&sessionId=0726e705-7e81-4120-b67c-93c2859a1095
- I see the "Resume your application" landing page, all my sections are complete until "Upload your documents", I can "continue" and answer the first question about materials
- But then when I continue onwards from that first question post-resume I get a blank screen and this console error:
- The
currentCard
of the blank screen isuMU15fLt77
- When testing yourselves, were you able to proceed successfully through more than one question after resuming?
Good catch! I just tried it now and it didn't work due to this line: visitedFns.forEach(([nodeId, _breadcrumb]) => {
flow[nodeId].edges?.map((edgeId) => {
if (flow[edgeId].type === TYPES.Answer && flow[edgeId].data?.val) {
visitedOptionVals.push(flow[edgeId].data.val);
}
});
}); I'll repeat the fix here for |
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.
Works as expected now, thanks to both you & @jamdelion for getting to the bottom of this one!
Running through the session and recreating it locally, we found the issue to be in the
autoAnswerableOptions
store function.The received error locally was:
After some logging we found the issue lying in
flow[nodeId]
beingundefined
in the Filter function.@jamdelion and I did find it hard to track why flow[nodeId] could be undefined for a save and return path. We thought it would be due to the node being deleted, but that wouldn't be consistent with the way published routes are handled for save and return flows (with the user always returning to the published flow they left from), so we were stumped here.
Important
What is the root cause of
flow[nodeId]
beingundefined
?