question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug with amplify generated composite keys

See original GitHub issue

Hello, I created a composite sort key using the amplify cli. The composite key includes the a person’s first and last name. Most of the time the composite key is generated correctly in Dynamo DB like: john#doe. However, sometimes it’ll be saved as ${ctx.args.input.first}#${ctx.args.input.last}. Subsequently, when I try to run a query with this composite key, it skips over the records that have this faulty composite key. I have not messed with any of the code auto generated by amplify and have confirmed that the first and last name values due indeed exist in the data row. Also, the primary keys were also defined. If anyone can point me in the right direction that would be great!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
paulssoncommented, Apr 21, 2021

@attilah @kaustavghosh06 @SwaySway @yuth @ammarkarachi @edwardfoyle @litwicki this is such a critical bug it should be at the highest priority of any work for Amplify CLI. This essentially makes accessing DynamoDB data that uses a composite sort key completely unreliable and inconsistent because a record “disappears” (is not returned) if an update is performed that does not include the fields that make up the composite sort key. This can cause customers to think their data just disappeared… how can anything be more critical to fix than that? This has already been well diagnosed. Can the Amplify community please have an update when this will be fixed?

3reactions
jdonbochcommented, Apr 20, 2021

any updates? still a bug after being identified over a year ago (v.4.49.0)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing custom primary key support for AWS Amplify ...
A React-based Movie Collection app with public read and write permissions; Users can delete records using custom primary and composite keys.
Read more >
Amplify AppSync: custom sorting and filtering with pagination
I your case I would create a composite key consisting of the category for the partition key and area and publishOn as the...
Read more >
@aws-amplify/datastore | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Appsync composite key (GSI in dynamodb) returns Null in ...
Hi, I have a appsync Schema which has composite key @key(name: ... I did amplify push and it successfully created GSI with the...
Read more >
[Best Tool Asset Store Award] Amplify Shader Editor
We aiming to generate clean shader code in order for users can to clearly see what is being done. Also this way is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found