-
Notifications
You must be signed in to change notification settings - Fork 251
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
Critical: DataStore GraphQL owner sub stored in wrong, duplicated format (sub::sub instead of sub) #5792
Comments
Hello @NiklasMeetyu thank you for taking the time to open this issue. We will try to reproduce the issue and get back to you. |
Hello @NiklasMeetyu, sorry for the delay but I've been unable to reproduce the issue thus far. Could please provide code samples and additional steps to reproduce please. I'm using your schema to generate users with the default and manually set OwnerIds:
Then I'm updating the owner to a new value. (Ive also tried updating the UserId with the same value and with null)
|
Hi @tyllark Thank you for investigating the bug! What we do (nothing/automatic ownerID assignment on creation and update): // NEW SETTING // UPDATE SETTING vs. what you do: Does this provide you with helpful context @tyllark ? Kind regards, |
Description
Dear Team,
currently our app launch is delayed because of this issue. We're using the AWS Amplify Gen 1 DataStore (android/iOS) in Flutter with Cognito Auth and store the sub (i.e. userid) automatically alongside our data. The graph ql schema does that for us automatically. See here:
type UserSettings
@model
@auth(
rules: [
{
allow: owner
ownerField: "ownerID"
operations: [create, update, delete, read]
},
{ allow: public, provider: apiKey, operations: [update, read] }
]
) {
id: ID!
name: String
language: String
ownerID: ID @index(name: "byOwnerID", queryField: "getUserSettingsByOwnerID")
}
In the AWS console we can see the data in DynamoDB where it is finally loaded automatically for us as part of the Amplify DataStore logic.
Issue:
We noticed, that in most "rows" in these Dynamo DB tables, the sub is stored wrongly like this:
sub::sub (e.g. hgusas-181273-...-1212::hgusas-181273-...-1212)
However, we would expect (which only in some case works)
sub (e.g. hgusas-181273-...-1212)
The mix up of two different formats leads to issues on our end. Can you please help us understand why the format is inconsistent? Adjusting our functions to identify duplicated data seems like a "dirty" solution that doesn't address the real problem. What do you think?
Kind regards,
Niklas
Categories
Steps to Reproduce
Screenshots
No response
Platforms
Flutter Version
3.27.0
Amplify Flutter Version
^2.3.0
Deployment Method
Amplify CLI (Gen 1)
Schema
The text was updated successfully, but these errors were encountered: