-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue with caching session data? #8
Comments
@adammockor I'll take a look into this today, looks like we need better test coverage because this is something that should've been caught before the PR came in. Just to make sure I understand the issue, let me know if this sounds accurate: you are saying after successful authentication the users session is persisted MongoDB but it isn't propagated to the cache. This causes an issue because the next request checks the cache and a cache miss occurs. The library does not go back to MongoDB for the session data. Is this right? |
Right, but there is never a cache miss. There is always data in |
Oh okay, so the issue is really that the cache isn't updating when there is fresh data in Mongo? You are just seeing the initial cached session from before authentication? |
Maybe some kind of async problem? Here is debug. I added url routes and replaced session data with
|
Did a bit of a rewrite today, still working on the testing of the new code. Any chance you could create a really simple example I could use to reproduce this result? If it's too much work I understand, I'll do my best to replicate on my own but figured I'd ask. |
I was trying to replicate it as close as possible, but here it is working as it should :(. Here is gist of my code. BTW in real app I am using passport-asana instead of fake auth in my gist. And no pressure, I can live with older version perfectly. Thank you for your work and time! |
Hello, since update
1.0.6
, I am experiencing issue that, session isn't correctly populated with data from MongoDB. After auth process user is correctly saved to session store in db, but next request gets data from cache where user data are not present.Maybe the problem is somewhere else, I am not sure, but everything works as expected, when I set version back to
1.0.5
or set express-session to default store.My express middleware flow is this:
package.json
The text was updated successfully, but these errors were encountered: