Skip to content

Intermittent Issue: Form Data Not Clearing Between Journeys #1394

Description

@ebadian

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:

  1. Complete the full journey once.
  2. Start the journey again from the beginning in the same browser.
  3. 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

  • Runner

Desktop (please complete the following information):

  • Browsers: All

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:

request.yar.reset();

Note:
here is the Yar api documentation.
https://hapi.dev/module/yar/api/?v=11.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions