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

Replication status header wrong key #4284

Closed
3 of 14 tasks
ranielison opened this issue Dec 25, 2023 · 4 comments
Closed
3 of 14 tasks

Replication status header wrong key #4284

ranielison opened this issue Dec 25, 2023 · 4 comments
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced pending-release Issues that have been addressed in main but have not been released storage Issues related to the Storage Category

Comments

@ranielison
Copy link

Description

Wrong key in the conversion of the replication status header to an enum. When downloading a file from AWS storage where the replication status is 'COMPLETED,' what is coming in the header status replication is 'COMPLETE' instead of 'COMPLETED,' causing an error in the application.

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

1 - Create a replication rule in your bucket to copy files to another bucket.
2 - Check the console to see if the replication status is COMPLETED.
3 - Try to download the file through your application.

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.10.5

Amplify Flutter Version

1.6.1

Deployment Method

Amplify CLI

Schema

No response

@haverchuck haverchuck added storage Issues related to the Storage Category pending-triage This issue is in the backlog of issues to triage labels Dec 25, 2023
@fjnoyp
Copy link
Contributor

fjnoyp commented Dec 26, 2023

Hi @ranielison thanks for sharing your issue. Can you clarify what error you are receiving and how this impacts your workflow? As a result of this key mismatch you are unable to download files using Amplify Storage targeting the copyTo bucket with files that were replicated in S3?

Looking at our code, it seems the replication_status.dart file generated via Smithy might need to be generated again (assuming the smithy templates are correct) so that the value COMPLETED is COMPLETE. Am able to verify online it should be COMPLETED: https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-status.html

@ranielison
Copy link
Author

@fjnoyp I am using the downloadData method to download files and display them in my application. However, an error occurs during the download, as it throws the exception below. I made a copy of your package to my machine to reproduce the issue, and I modified the replication_status.dart file, changing the key from 'COMPLETE' to 'COMPLETED,' and it worked perfectly.

E/flutter ( 4214): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: No element
E/flutter ( 4214): #0 ListBase.firstWhere (dart:collection/list.dart:132:5)
E/flutter ( 4214): #1 ReplicationStatusHelpers.byValue
replication_status.dart:73
E/flutter ( 4214): #2 new GetObjectOutput.fromResponse.
get_object_output.dart:227
E/flutter ( 4214): #3 GetObjectOutputBuilder.update
get_object_output.g.dart:449
E/flutter ( 4214): #4 new _$GetObjectOutput
get_object_output.g.dart:84
E/flutter ( 4214): #5 new GetObjectOutput.fromResponse
get_object_output.dart:117
E/flutter ( 4214): #6 GetObjectOperation.buildOutput
get_object_operation.dart:359
E/flutter ( 4214): #7 HttpOperation.deserializeOutput
http_operation.dart:273
E/flutter ( 4214):

@fjnoyp
Copy link
Contributor

fjnoyp commented Dec 27, 2023

Good to hear @ranielison. We'll look into regenerating the smithy dart code or manually changing to COMPLETED to fix this.

@haverchuck haverchuck added bug Something is not working; the issue has reproducible steps and has been reproduced and removed pending-triage This issue is in the backlog of issues to triage labels Dec 28, 2023
@haverchuck haverchuck added the pending-release Issues that have been addressed in main but have not been released label Jan 8, 2024
@haverchuck
Copy link
Member

This is resolved in amplify flutter 1.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced pending-release Issues that have been addressed in main but have not been released storage Issues related to the Storage Category
Projects
None yet
Development

No branches or pull requests

3 participants