parse-community / parse-community/parse-server
Session cache being deleted too often
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
Issue Description
When we monitor our calls to the redis cache, we can see that the user session is regularly missed even (sometimes every minutes, sometimes after 5 or 10 minutes) with a TTL of one hour.
It's hard to figure out why, but this line could be a (small) part of the explanation.
Instead of just removing all keys (of all sessionTokens) of that user, wouldn't it be possible to refresh them with the updated user?
It's clearly not the only reason, as when investigating we see cache misses for a sessionToken even with the user not being updated (no change in the updatedAt field), but it's the only reason we've figured for now...
If you have other ideas, I would be happy to test them :)
Server version: 4.2.0 on AWS Elasticbeanstalk (or local)
Database : MongoDB on Mongo Atlas
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/RestWrite.js around line 501 and tracing the session-token cache invalidation triggered by user updates. Reproduce the reported Redis misses with a one-hour TTL, then establish whether this invalidation explains them and verify the resulting cache behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, node.js, redis
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100