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

support s3 directories with more than 1000 keys #315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewresnikoff
Copy link

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.

cb(new Error("Missing CommonPrefixes from S3 Response"));
return;
}
else {
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return
return;

});

if (data.IsTruncated) {
params.ContinuationToken = data.NextContinuationToken;
Copy link
Member

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 => {
Copy link
Member

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?

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.

support s3 directories with more than 1000 keys
2 participants