alphagov / govuk-prototype-kit

Rapidly create HTML prototypes of GOV.UK services
https://prototype-kit.service.gov.uk
MIT License
303 stars 236 forks source link

Changes to session data defaults are not reflected in a running prototype #1850

Open joelanman opened 1 year ago

joelanman commented 1 year ago

Context

From support:

In v13 we changed the way we store session data. Instead of in memory, we store it in files. This means data isn't lost when the kit restarts.

A side effect is that if you change the default session data after starting a session, this is now not represented in session unless you use the Clear data page.

From support we've heard this is an issue for some users.

Alternatives

Use Clear data page, however this is slower than the old approach (the kit restarted and the default session data updated the session) and loses your place in your prototype

One suggestion - we could make Clear data Ajax so its quicker and you keep your place in the prototype.

tomyems commented 1 year ago

It would also be useful to be able to add additional functionality to the clear data button through the manage prototype. In prototypes where users can upload images, and have them displayed back, they're actually uploading the image which is stored, until the data is cleared.

A next() function on the '/manage-prototype/clear-data' route, would allow an additional route to be able to customise any additional required action.

edwardhorsford commented 1 year ago

I'd like to be able to restore the old functionality / way of working that changes within the kit to javascript (routes, filters, session data defaults) all reset session data. I'm currently working on routes and it's harder to test them when the journeys don't get reset each time.

For my use case I think this would need a global config or something - I'd like the old behaviour