Skip to content

Conversation

osama-rizk
Copy link
Contributor

@osama-rizk osama-rizk commented Jul 2, 2025

Description of changes:

Missing arrow operator (=>) in the onProgress callback function was causing a syntax error.

Instructions

If this PR should not be merged upon approval for any reason, please submit as a DRAFT

Which product(s) are affected by this PR (if applicable)?

  • amplify-cli
  • amplify-ui
  • amplify-studio
  • amplify-hosting
  • amplify-libraries

Which platform(s) are affected by this PR (if applicable)?

  • JS
  • Swift
  • Android
  • Flutter
  • React Native

Please add the product(s)/platform(s) affected to the PR title

Checks

  • Does this PR conform to the styleguide?

  • Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.

  • Are any files being deleted with this PR? If so, have the needed redirects been created?

  • Are all links in MDX files using the MDX link syntax rather than HTML link syntax?

    ref: MDX: [link](https://docs.amplify.aws/)
    HTML: <a href="https://docs.amplify.aws/">link</a>

When this PR is ready to merge, please check the box below

  • Ready to merge

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

@osama-rizk osama-rizk requested review from hdworld11, harsh62 and a team as code owners July 2, 2025 16:58
final operation = Amplify.Storage.downloadData(
path: const StoragePath.fromString('public/example.txt'),
onProgress: (progress) {
onProgress: (progress) => {
Copy link
Contributor

@sarayev sarayev Jul 3, 2025

Choose a reason for hiding this comment

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

Afaik, arrow syntax (=>) is not required for the function definitions where the function body is implemented between curly brackets {} in dart. Where does these cause syntax errors?

Copy link
Contributor Author

@osama-rizk osama-rizk Jul 3, 2025

Choose a reason for hiding this comment

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

I just copy pasted the code samples and I find an error. Please check the following sandbox app that have the sample code with out the fix. https://codesandbox.io/p/devbox/65nxnl?file=%2Fsrc%2FApp.jsx%3A17%2C1-18%2C1 . Putting an arrow operator should fix the issue

Copy link
Contributor Author

@osama-rizk osama-rizk Jul 4, 2025

Choose a reason for hiding this comment

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

Reverted the dart syntax change.

@osama-rizk osama-rizk merged commit b3919cb into main Jul 4, 2025
12 checks passed
@osama-rizk osama-rizk deleted the fix-storage-doc branch July 4, 2025 12:58
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.

3 participants