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

fix(lru-cache, memory, mongodb, redis): return falsy values when set in storage #320

Merged
merged 2 commits into from Nov 14, 2023

Conversation

patzick
Copy link
Contributor

@patzick patzick commented Oct 13, 2023

πŸ”— Linked issue

  • no related issue, just created fix when discovered it

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I have noticed, that values resolved as Falsy were returned as null.
This PR is adding test for the driver to check if it returns values like 0 or false and not null and replaced some of the drivers that were returning incorrect results.

As the result null is returned only when:

  1. there is no value in storage
  2. value in storage is null
  3. value in storage is undefined

cheers :)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0 pi0 changed the title fix: return falsy values when set in storage fix(lru-cache, memory, mongodb, redis): return falsy values when set in storage Oct 17, 2023
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’― Nice fixes!

@patzick
Copy link
Contributor Author

patzick commented Oct 20, 2023

thanks, @pi0, I updated the missing snapshot which was skipped locally :)
After you'll merge this one I'll resolve the conflict in #321 and prepare it for merging as well!

@patzick
Copy link
Contributor Author

patzick commented Nov 7, 2023

hey @pi0 could we merge this? If something's missing just let me know :)

@pi0
Copy link
Member

pi0 commented Nov 7, 2023

Sorry for delay. CI seemd to be failing i guess should be fixed now i will include this next minor version πŸ‘πŸΌ

@pi0 pi0 merged commit eb6a2b4 into unjs:main Nov 14, 2023
2 of 3 checks passed
@patzick patzick deleted the fix/return-falsy-values branch November 14, 2023 17:47
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.

None yet

2 participants