Skip to content
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

Getting errors about session file store when 2 prototypes have the same name #1733

Closed
joelanman opened this issue Oct 28, 2022 · 2 comments · Fixed by #2021
Closed

Getting errors about session file store when 2 prototypes have the same name #1733

joelanman opened this issue Oct 28, 2022 · 2 comments · Fixed by #2021
Assignees
Labels
🐛 Bug Something isn't working the way it should (including incorrect wording in documentation)

Comments

@joelanman
Copy link
Contributor

joelanman commented Oct 28, 2022

Description of the issue

When running v13 I get this output in the terminal:

[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open '/Users/joelanman/projects/starter3/.tmp/sessions/FJWPmQnb3pF2KZVp5cfDxgcJpeHRgwFm.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open '/Users/joelanman/projects/starter3/.tmp/sessions/FJWPmQnb3pF2KZVp5cfDxgcJpeHRgwFm.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open '/Users/joelanman/projects/starter3/.tmp/sessions/FJWPmQnb3pF2KZVp5cfDxgcJpeHRgwFm.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open '/Users/joelanman/projects/starter3/.tmp/sessions/FJWPmQnb3pF2KZVp5cfDxgcJpeHRgwFm.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open '/Users/joelanman/projects/starter3/.tmp/sessions/FJWPmQnb3pF2KZVp5cfDxgcJpeHRgwFm.json'

It will try five times to find the file and then just create a new session, so the issue is just console warnings

Steps to reproduce the issue

  • start a prototype in one folder, visit the home page, stop that prototype
  • start another prototype and visit the homepage

Actual vs expected behaviour

Shouldn't get warnings in the terminal

Environment (where applicable)

  • Operating system: MacOS
  • Browser: Chrome
  • GOV.UK Prototype Kit version: 13
@lfdebrux
Copy link
Member

lfdebrux commented Oct 28, 2022

I think there is a step missing from 'steps to reproduce the issue': if I visit the page with an incognito browser or having cleared my cookies, the error won't appear. What is needed to reproduce this is start a prototype in one folder, visit the home page, stop that prototype, then start another prototype and visit the homepage for that.

The output we then see is the expected behaviour of session-file-store, because the browser cookies contain a session key for a session from another prototype. So I'm not sure whether we want to just suppress these warnings, or what?

Edit to add: the two prototypes also have to have the same service name, as we currently base the name of the cookie on the service name. If the two prototypes have different service names the sessions can happily coexist. So I guess we could fix this by using something other than the service name for generating the cookie name?

@joelanman
Copy link
Contributor Author

thanks, I didn't know thats what was causing it, will update the steps to reproduce

@joelanman joelanman changed the title Getting errors about session file store Getting errors about session file store when 2 prototypes have the same name Oct 28, 2022
@joelanman joelanman added 🐛 Bug Something isn't working the way it should (including incorrect wording in documentation) and removed awaiting triage labels Jan 10, 2023
@HannahJMWood HannahJMWood linked a pull request Mar 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working the way it should (including incorrect wording in documentation)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants