aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

fix(storage): nextToken is not surfaced when list result contain only CommonPrefix #13933

Closed HuiSF closed 1 month ago

HuiSF commented 1 month ago

Description of changes

It is a legit case that ListObjectV2 returns a result that contains only CommonPrefix[] and without a Content, and NextContinuationToken can be returned as well.

The current implementation omits nextToken for this case, and makes listing next page impossible.

Fix: surface the nextToken

Issue #, if available

Description of how you validated changes

Checklist

Checklist for repo maintainers

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ashika112 commented 1 month ago

Thanks Hui Nice Catch !