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

Handle case where key has expired or been deleted #77

Closed
wants to merge 4 commits into from

Conversation

dustinmartin
Copy link

This PR fixes a bug caused by express-redis-cache attempting to get a key that has been deleted or expired.

This scenarios happens like this:

  1. key is looked up in Redis get.js, line 36
  2. key expires or is deleted from Redis
  3. key is retrieved from Redis get.js, line 43. hgetall returns null since the key no longer exists.
  4. the function attempts to set properties on the null value, get.js, line 45 which results in an error being thrown and the app crashing.

I ran the tests and they all pass though I did not add a new test. Due to the nature of this bug I wasn't sure how to go about creating a new test. Please let me know if I need to make some changes. Thanks.

mitmak777 pushed a commit to mitmak777/express-redis-cache that referenced this pull request Oct 12, 2016
Daniel Tijerina and others added 2 commits May 9, 2017 13:53
@krazyjakee
Copy link
Collaborator

#84

@krazyjakee krazyjakee closed this Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants