-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(storage): omit subPathStrategy when prefix is defined #13606
Conversation
a03fdfe
to
7077aa5
Compare
@@ -81,7 +81,9 @@ export const list = async ( | |||
Prefix: isInputWithPrefix ? `${generatedPrefix}${objectKey}` : objectKey, | |||
MaxKeys: options?.listAll ? undefined : options?.pageSize, | |||
ContinuationToken: options?.listAll ? undefined : options?.nextToken, | |||
Delimiter: getDelimiter(options.subpathStrategy), | |||
Delimiter: getDelimiter( | |||
(options as ListAllWithPathInput['options'])?.subpathStrategy, |
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.
The service Delimiter
option is shared for both key
and path
options. If getDelimiter
resolves to undefined, it will not be propagated to the server – This was currently discussed on a different thread.
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.
rather than casting i would make use of isInputWithPrefix
or isInputWithPath
here and use that to narrow down the type and make the call
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.
A type guard here will just create extra code that is not needed. It'd make sense to add it if we are conditionally rendering something or if getDelimiter
is accepting a Truthy
value.
I expanded the getDelimiter
param type to accept options
instead. This removes the need to cast the subpathStrategy
options.
The PR is also missing removing the |
b98302b
to
4c51193
Compare
…s-amplify#13606)" This reverts commit d3b9546.
…y#13606) * fix: omit subPathStrategy on prefix * chore: fix build * chore: address feedback
* fix(storage): omit subPathStrategy when prefix is defined (#13606) * fix: omit subPathStrategy on prefix * chore: fix build * chore: address feedback * chore: omit subpathStrategy from options * chore: add unit tests * chore: update tests * chore: fix test * chore: move subpathstrategy to service options * chore: update comment * chore: fix type
commit 381ca11 Author: ashika112 <akasivis@amazon.com> Date: Tue Jul 23 13:01:22 2024 -0700 update bundle size commit df890f1 Merge: 043d913 b473ce3 Author: ashika112 <akasivis@amazon.com> Date: Tue Jul 23 12:52:15 2024 -0700 Merge branch 'main' of github.com:aws-amplify/amplify-js into feat/multi-bucket commit b473ce3 Author: Ashwin Kumar <ashwinkumar2468@gmail.com> Date: Tue Jul 23 10:13:25 2024 -0700 fix(rtn-web-browser): signInWithRedirect needs to be called twice on Android * fix(rtn-web-browser): signInWithRedirect needs to be called twice on Android * chore: add code owner * address feedback * update codeowners * update codeowners * Update .github/CODEOWNERS --------- Co-authored-by: Ashwin Kumar <ashwsrir@amazon.com> commit 3d70792 Author: israx <70438514+israx@users.noreply.github.com> Date: Tue Jul 23 08:19:21 2024 -0400 fix(storage): omit subPathStrategy when prefix is defined (aws-amplify#13618) * fix(storage): omit subPathStrategy when prefix is defined (aws-amplify#13606) * fix: omit subPathStrategy on prefix * chore: fix build * chore: address feedback * chore: omit subpathStrategy from options * chore: add unit tests * chore: update tests * chore: fix test * chore: move subpathstrategy to service options * chore: update comment * chore: fix type commit 9fb5988 Merge: 60a559f 4c7e6ed Author: AllanZhengYP <zheallan@amazon.com> Date: Mon Jul 22 17:30:32 2024 -0700 chore: Merge release into main (aws-amplify#13623) commit 4c7e6ed Author: aws-amplify-bot <aws@amazon.com> Date: Mon Jul 22 22:38:34 2024 +0000 chore(release): Update API docs [skip release] commit 5c372cc Author: aws-amplify-bot <aws@amazon.com> Date: Mon Jul 22 22:37:14 2024 +0000 chore(release): Publish [skip release] - @aws-amplify/adapter-nextjs@1.2.9 - @aws-amplify/analytics@7.0.39 - @aws-amplify/api@6.0.41 - @aws-amplify/api-graphql@4.1.10 - @aws-amplify/api-rest@4.0.39 - @aws-amplify/auth@6.3.10 - aws-amplify@6.4.2 - @aws-amplify/core@6.3.6 - @aws-amplify/datastore@5.0.41 - @aws-amplify/datastore-storage-adapter@2.1.41 - @aws-amplify/geo@3.0.39 - @aws-amplify/interactions@6.0.38 - @aws-amplify/notifications@2.0.39 - @aws-amplify/predictions@6.1.14 - @aws-amplify/pubsub@6.1.14 - @aws-amplify/storage@6.5.2 - tsc-compliance-test@0.1.44 commit 4efe9be Author: aws-amplify-bot <aws@amazon.com> Date: Mon Jul 22 22:37:01 2024 +0000 chore(release): Set core metadata [skip release] commit 9cc959a Merge: 02abc66 60a559f Author: AllanZhengYP <zheallan@amazon.com> Date: Mon Jul 22 15:01:44 2024 -0700 release(required): Amplify JS release (aws-amplify#13622) commit 60a559f Author: Hui Zhao <10602282+HuiSF@users.noreply.github.com> Date: Fri Jul 19 16:36:55 2024 -0700 fix(aws-amplify): createKeyValueStorageFromCookieStorageAdapter misses default path and secure values (aws-amplify#13508) * fix(aws-amplify): createKeyValueStorageFromCookieStorageAdapter misses default path and secure values * Ensure Path is being serialized * Delete cookie without path attr before setting it commit aa7ae18 Merge: 60885b7 02abc66 Author: AllanZhengYP <zheallan@amazon.com> Date: Fri Jul 19 10:16:51 2024 -0700 chore: Merge release into main (aws-amplify#13616) commit 02abc66 Author: aws-amplify-bot <aws@amazon.com> Date: Fri Jul 19 01:38:05 2024 +0000 chore(release): Update API docs [skip release] commit cae6274 Author: aws-amplify-bot <aws@amazon.com> Date: Fri Jul 19 01:36:39 2024 +0000 chore(release): Publish [skip release] - @aws-amplify/adapter-nextjs@1.2.8 - @aws-amplify/analytics@7.0.38 - @aws-amplify/api@6.0.40 - @aws-amplify/api-graphql@4.1.9 - @aws-amplify/api-rest@4.0.38 - @aws-amplify/auth@6.3.9 - aws-amplify@6.4.1 - @aws-amplify/core@6.3.5 - @aws-amplify/datastore@5.0.40 - @aws-amplify/datastore-storage-adapter@2.1.40 - @aws-amplify/geo@3.0.38 - @aws-amplify/interactions@6.0.37 - @aws-amplify/notifications@2.0.38 - @aws-amplify/predictions@6.1.13 - @aws-amplify/pubsub@6.1.13 - @aws-amplify/react-native@1.1.3 - @aws-amplify/rtn-push-notification@1.2.31 - @aws-amplify/storage@6.5.1 - tsc-compliance-test@0.1.43 commit 71683a4 Author: aws-amplify-bot <aws@amazon.com> Date: Fri Jul 19 01:36:24 2024 +0000 chore(release): Set core metadata [skip release] commit 880dfdc Merge: dc2fc7b 60885b7 Author: AllanZhengYP <zheallan@amazon.com> Date: Thu Jul 18 17:03:14 2024 -0700 release: Amplify JS release (aws-amplify#13612) commit 60885b7 Author: israx <70438514+israx@users.noreply.github.com> Date: Thu Jul 18 17:28:30 2024 -0400 Revert "fix(storage): omit subPathStrategy when prefix is defined (aws-amplify#13614) Revert "fix(storage): omit subPathStrategy when prefix is defined (aws-amplify#13606)" This reverts commit d3b9546. commit d3b9546 Author: israx <70438514+israx@users.noreply.github.com> Date: Thu Jul 18 14:31:27 2024 -0400 fix(storage): omit subPathStrategy when prefix is defined (aws-amplify#13606) * fix: omit subPathStrategy on prefix * chore: fix build * chore: address feedback commit af46e39 Author: Hui Zhao <10602282+HuiSF@users.noreply.github.com> Date: Wed Jul 17 12:15:58 2024 -0700 fix(rtn-push-notification): wrong completion handler key (aws-amplify#13604) commit 1cc40e3 Merge: e3a10ca 6f3e0d8 Author: Jim Blanchard <jim.l.blanchard@gmail.com> Date: Thu Jul 11 09:41:22 2024 -0500 chore: Merge release into main (aws-amplify#13570) commit 6f3e0d8 Merge: dc2fc7b e3a10ca Author: Jim Blanchard <jim.l.blanchard@gmail.com> Date: Thu Jul 11 09:28:45 2024 -0500 Merge branch 'main' into temp/release-merge-1720476144 commit e3a10ca Author: James Jarvis <jjarvisp@amazon.com> Date: Tue Jul 9 16:30:02 2024 -0400 downgrade react-native-get-random-values from >=1.9.0 to >=1.8.0 (aws-amplify#13573) The purpose of this change is to downgrade the react-native-get-random-values peer dependency from >=1.9.0 to >=1.8.0.Expo 50 utilizes 1.8.0 as a dependency and amplify-js dependency of 1.9.0 produced installation friction when getting started via the recommended workflow. Dropping the peer dep version will remove installation friction while having no impact on current library functionality. commit dc2fc7b Author: aws-amplify-bot <aws@amazon.com> Date: Mon Jul 8 22:05:06 2024 +0000 chore(release): Update API docs [skip release] commit 884f77a Author: aws-amplify-bot <aws@amazon.com> Date: Mon Jul 8 22:03:39 2024 +0000 chore(release): Publish [skip release] - @aws-amplify/adapter-nextjs@1.2.7 - @aws-amplify/analytics@7.0.37 - @aws-amplify/api@6.0.39 - @aws-amplify/api-graphql@4.1.8 - @aws-amplify/api-rest@4.0.37 - @aws-amplify/auth@6.3.8 - aws-amplify@6.4.0 - @aws-amplify/core@6.3.4 - @aws-amplify/datastore@5.0.39 - @aws-amplify/datastore-storage-adapter@2.1.39 - @aws-amplify/geo@3.0.37 - @aws-amplify/interactions@6.0.36 - @aws-amplify/notifications@2.0.37 - @aws-amplify/predictions@6.1.12 - @aws-amplify/pubsub@6.1.12 - @aws-amplify/react-native@1.1.2 - @aws-amplify/rtn-push-notification@1.2.30 - @aws-amplify/storage@6.5.0 - tsc-compliance-test@0.1.42 commit cf6fe30 Author: aws-amplify-bot <aws@amazon.com> Date: Mon Jul 8 22:03:24 2024 +0000 chore(release): Set core metadata [skip release] commit 1d353e7 Merge: 8cc3fd5 0a07393 Author: Ashwin Kumar <ashwinkumar2468@gmail.com> Date: Mon Jul 8 14:14:12 2024 -0700 release: Amplify JS release (aws-amplify#13569) commit 0a07393 Author: israx <70438514+israx@users.noreply.github.com> Date: Mon Jul 8 11:17:57 2024 -0400 feat(storage): enable storage Next JS app (aws-amplify#13555) feat: enable storage next js app commit 95ba49c Author: israx <70438514+israx@users.noreply.github.com> Date: Mon Jul 8 11:06:49 2024 -0400 feat(storage): add delimiter support to list API (aws-amplify#13517) * feat: add types * feat: enable delimiter * chore: add unit tests * chore: bump bundle size * chore: add tsdocs * chore: address feedback * chore: address feedback * chore: address feedback commit 0f5f4cb Author: Rami Elwan <ramielwan48@gmail.com> Date: Mon Jul 1 21:42:54 2024 +0200 fix(datastore): handle case when getting auth info for expired token users (aws-amplify#13536) fix: handle case when getting auth info for expired token users Co-authored-by: Aaron S <94858815+stocaaro@users.noreply.github.com> commit b6de5f9 Author: Hui Zhao <10602282+HuiSF@users.noreply.github.com> Date: Wed Jun 26 11:23:35 2024 -0700 chore: enabling linting on __tests__ for the react-native packages (aws-amplify#13545) * chore: enabling linting on __tests__ for the react-native packages * chore(rtn-push-notification): run yarn lint:fix * chore(rtn-push-notification): manual fix linter errors commit 2ef7c59 Author: Ashwin Kumar <ashwinkumar2468@gmail.com> Date: Tue Jun 25 18:00:35 2024 -0700 chore: update PRs checklist to also add/update E2E tests (aws-amplify#13543) * chore: update PRs checklist to also add/update E2E tests * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com> * address feedback --------- Co-authored-by: Ashwin Kumar <ashwsrir@amazon.com> Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>
Description of changes
The
subpathStrategy
option is currently added to theprefix
input of thelist
, which is deprecated already. This change is excluding thesubpathStrategy
key when thelist
API hasprefix
as part of the input.Issue #, if available
Description of how you validated changes
before:
after:
Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.