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(cloudflare-kv-binding): go through all pages to list the keys #459

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

farnabaz
Copy link
Collaborator

@farnabaz farnabaz commented Jul 5, 2024

Based on the official documentation, KV list function has maximum limit of 1000 keys. In order to get all keys from the KV binding, we need to go through all pages using the cursor property.

This PR updates getKeys function to leverage cursor.

Screenshot 2024-07-05 at 14 15 37

Originally raised in nuxt-hub/platform#254

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.73%. Comparing base (4d61c78) to head (6c21271).
Report is 52 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #459      +/-   ##
==========================================
+ Coverage   65.05%   66.73%   +1.68%     
==========================================
  Files          39       39              
  Lines        4055     4137      +82     
  Branches      487      512      +25     
==========================================
+ Hits         2638     2761     +123     
+ Misses       1408     1367      -41     
  Partials        9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi0 pi0 changed the title fix(cf-kv): go through all pages to list the keys fix(cloudflare-kv-binding): go through all pages to list the keys Jul 5, 2024
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.

Thanks! (release might be in next please since there are other unreleased features. please ping me if was urgent to use hotfix)

@pi0 pi0 merged commit 8c41e3e into unjs:main Jul 5, 2024
4 checks passed
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