-
Notifications
You must be signed in to change notification settings - Fork 66
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
support s3 directories with more than 1000 keys #315
base: master
Are you sure you want to change the base?
support s3 directories with more than 1000 keys #315
Conversation
cb(new Error("Missing CommonPrefixes from S3 Response")); | ||
return; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the else
here is necessary. Once we've completed the null checks on the CommonPrefixes
, Contents
, and data
then we'll always do the processing below.
if (data.IsTruncated) { | ||
params.ContinuationToken = data.NextContinuationToken; | ||
listAllKeys(cb); | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return | |
return; |
}); | ||
|
||
if (data.IsTruncated) { | ||
params.ContinuationToken = data.NextContinuationToken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is NextContinunationToken
guaranteed to be set if IsTruncated
is true (seems like yes based on the docs) or do we need an additional null-check?
else { | ||
var contents = data.Contents; | ||
var prefixes = data.CommonPrefixes; | ||
contents.forEach(content => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not using map
here and for prefixes
?
Fixes #314, where commuter only displays first 1000 keys in s3 buckets.
I'm not really familiar with javascript so apologies if the style/solution here is bad - it fixed my use case though.