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 for ContinuationToken? #92

Open
adrian-kriegel opened this issue Aug 17, 2022 · 1 comment
Open

Support for ContinuationToken? #92

adrian-kriegel opened this issue Aug 17, 2022 · 1 comment

Comments

@adrian-kriegel
Copy link

I have noticed that listObjectsV2 does not return NextContinuationToken which is required when iterating through larger sets of objects on S3.
The response looks like this:

{
      Contents: [
        {
          Key: 'file_0',
          ETag: '"cc6c6102174b3050bc3397c724f00f63"',
          LastModified: 2022-08-17T13:10:29.351Z,
          Size: 3
        },
        {
          Key: 'file_1',
          ETag: '"cc6c6102174b3050bc3397c724f00f63"',
          LastModified: 2022-08-17T13:10:29.351Z,
          Size: 3
        }
      ],
      CommonPrefixes: [ { Prefix: '/' } ],
      IsTruncated: true,
      NextContinuationToken: undefined,
      ContinuationToken: undefined,
      StartAfter: undefined
}

Note that while the tokens are missing, isTruncated is still set to true, which would lead to an infinite loop in many applications.

@adrian-kriegel
Copy link
Author

Looking at the code, this should be supported. But it requires Delimiter to be set to some arbitrary character.

mock.js line 228:

		if (truncated && search.Delimiter) {
			result.NextMarker = _.last(result.Contents).Key
		}

Is this also the behavior expected from AWS S3?

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

No branches or pull requests

1 participant