-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add ADR for storing responses in the query string #5212
Conversation
a00301d
to
4b3f5f8
Compare
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.
Sounds good to me 👍 I particularly like that it will unify the controller logic (benefits devs), and that we can be smarter about letting users edit their early responses (better user experience).
4b3f5f8
to
f32980a
Compare
f32980a
to
ba8e35e
Compare
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 sounds a good proposal for me 👍 there's a few areas I've got extra questions and opinions.
1. Rename `SessionAnswersController` to `FlowController` (as will be used to handle all flows) | ||
1. Change `use_session` configuration option in flow definition to specify different response store types. e.g. `response_store :session` | ||
1. Add functionality to store responses in query string | ||
1. Migrate existing flows incrementally to use query string by specifying config option e.g. `response_store :query_string` |
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.
Will there be any backwards compatibility? i.e. once say https://www.gov.uk/marriage-abroad/y/afghanistan/uk/partner_british/opposite_sex is migrated would this 404? redirect me to start of a results page? back to start of Smart Answer?
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 catch. We need to cover those who are in the middle of doing a flow, and old links that might be saved.
Feels like there's scale of effort vs disruption for users and depends on the amount of traffic (how many user's would be effected).
Most effort, minimal disruption:
Add logic to translate old urls into new query string based ones.
Medium effort, medium disruption:
Redirect all old URLs to the start page.
Low effort, high disruption:
Drop the old routes for old URLs and 404.
Safest approach would be to:
- Initially keep the existing controller to handle old URL requests (we can distinguish them by the extra
/y/
vs/s/
segment after the flow name). - Add routes for both URL types in the content item (for router).
- Update the start page to point to the query string based flow.
- Wait a period of time to let previous active users finish their current flow.
- Keep an eye on traffic to the old URLs
- Then decide on level of effort thats needed?
My gut feeling is we don't actually have that many people save URLs or link directly to results, and that we'd probably be fine to just redirect to the start page.
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.
Yeah I think it's fine to have something that is intermediary and then remove. I think that could be neater too as we could set redirects in Publishing API for all the /y URL's at the point of removal and then not need any /y handling code in this app.
How do you feel about using this as a chance to change /s/ and /y/ to something more understandable? a quick idea I had is /flow/ ? Just a thought given it's going to be a bit disruptive anyway.
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.
Yup agree - should try and add the redirect in Publishing API. Would let us really clean everything up.
I think that's a good idea about renaming /s/ - I'm slightly worried about adding extra work to implement this change - (would have to migrating the existing session based answer (find-coronavirus-support) as well). I also wonder if it's worth, outside this ADR, thinking about whether we can remove it all together.
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 re: redirect
I think that's a good idea about renaming /s/ - I'm slightly worried about adding extra work to implement this change - (would have to migrating the existing session based answer (find-coronavirus-support) as well). I also wonder if it's worth, outside this ADR, thinking about whether we can remove it all together.
Yeah getting rid altogether sounds ideal but I agree that's out of the scope of this.
I think the renaming should be in the scope of this as /s/ will leave a bit of a smell behind. The s stands for session as I recall? Since every other Smart Answer needs migrating anyway it'd seem the extra work is very low since it'd be a different application of the same process. Only tricky thing seems to be agreeing on what the rename should be 😁
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.
Sure, you are right it'll less work now than later. /flow/ does make sense - it's short and descriptive. Struggling to think of any alternatives, maybe /nodes/
(but prefer flow
)?
Another thing is to make sure it's not confusing users who won't be familiar with these concepts.
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.
Sounds good - yeah it seems a step up from /y/ anyway for confusion.
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've added a section talking about the prerequisite work to update /s/ to /flow/ - including suggested step of implementation.
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.
Hi @theseanything - looks great. Just a couple of suggestions 👍
This updates the background to give more context over how smart answers resolves the current node with responses in the URL path.
@kevindew I hope I've been able to clarify your questions. Let me know if there is anything else blocking this from going ahead. |
0f371b8
to
e8abb3d
Compare
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.
Fantastic work and an excellent description of what and why this change should be made.
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.
Sounds good to me, nice one @theseanything
Thanks everyone for you comments and reviews 🎉 |
View rendered 🖼️