Describe the bug
When a user completes a journey and attempts to start a new one in the same browser session, the form is occasionally pre‑populated with data from the previous submission. This does not happen consistently, which makes the issue difficult to reliably reproduce.
To Reproduce
Steps to reproduce the behavior:
- Complete the full journey once.
- Start the journey again from the beginning in the same browser.
- Observe that, intermittently, previous form data is pre-filled.
Note: The issue occurs sporadically and may require multiple attempts.
Expected behavior
All cached or stored user state should be fully cleared, ensuring each new journey starts with an empty form.
Screenshots
N/A
Repository
Desktop (please complete the following information):
Additional context
Using cache.drop() is unreliable for clearing Yar sessions because it target the underlying catbox cache, which isn't part of Yar's public API and may not consistently remove the session entry. Yar only guarantees behaviour through its own session methodsUse request.yar.reset() instead — it's the officially supported way to fully clear a session and ensures Yar handles both cookie + server‑side storage correctly.
The clearState function in cacheService currently uses cache.drop. This may not fully clear the session state. It may need to explicitly reset Yar using:
Note:
here is the Yar api documentation.
https://hapi.dev/module/yar/api/?v=11.0.3
Describe the bug
When a user completes a journey and attempts to start a new one in the same browser session, the form is occasionally pre‑populated with data from the previous submission. This does not happen consistently, which makes the issue difficult to reliably reproduce.
To Reproduce
Steps to reproduce the behavior:
Note: The issue occurs sporadically and may require multiple attempts.
Expected behavior
All cached or stored user state should be fully cleared, ensuring each new journey starts with an empty form.
Screenshots
N/A
Repository
Desktop (please complete the following information):
Additional context
Using
cache.drop()is unreliable for clearing Yar sessions because it target the underlying catbox cache, which isn't part of Yar's public API and may not consistently remove the session entry. Yar only guarantees behaviour through its own session methodsUserequest.yar.reset()instead — it's the officially supported way to fully clear a session and ensures Yar handles both cookie + server‑side storage correctly.The clearState function in cacheService currently uses
cache.drop. This may not fully clear the session state. It may need to explicitly reset Yar using:Note:
here is the Yar api documentation.
https://hapi.dev/module/yar/api/?v=11.0.3