-
Notifications
You must be signed in to change notification settings - Fork 200
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
AppSyncRealTimeClient Subscription events failing #3134
Comments
Removing the auth rules for group field seems to be a workaround for now. |
Hey @ChadyG, could you provide us with the schema containing auth rules for groups with groupsField so that we can try to reproduce it? |
Of course. The LmShot and LmSession (which contains shots) are the models adding the groups field authorization rules.
|
Thanks for providing the information. Our team is actively prioritizing and working on issues. We will provide an update as soon as we have one on the issue. |
Thanks @harsh62! |
Hi @ChadyG, thanks for the schema. From the error message,
are you by any chance passing in a syncExpression? subscription filters are applied from translating the sync expression. If there is, there could be a problem with the translation from syncExpression to GraphQL filter variable. If there isn't then we will have to pass this forward to https://github.com/aws-amplify/amplify-category-api. Our next steps here from the library perspective is to try out your schema and apply the same sync expression if there is. If it is reproducible, we would then replay the request directly in the AppSync console against the LmShot model. |
Hello @lawmicha, func syncExpressions() -> [DataStoreSyncExpression] {
func userId() -> String {
Amplify.Auth.getCurrentUser()?.userId ?? "dont-sync"
}
return [
DataStoreSyncExpression.syncExpression(LmClub.schema, where: {
return LmClub.keys.owner.eq(userId())
}),
DataStoreSyncExpression.syncExpression(LmDevice.schema, where: {
return LmDevice.keys.owner.eq(userId())
}),
DataStoreSyncExpression.syncExpression(LmProfile.schema, where: {
return LmProfile.keys.userId.eq(userId())
}),
DataStoreSyncExpression.syncExpression(LmSession.schema, where: {
return LmSession.keys.owner.eq(userId())
}),
DataStoreSyncExpression.syncExpression(LmSessionStats.schema, where: {
return LmSessionStats.keys.owner.eq(userId())
}),
DataStoreSyncExpression.syncExpression(LmUserStats.schema, where: {
return LmUserStats.keys.owner.eq(userId())
}),
DataStoreSyncExpression.syncExpression(LmUser.schema, where: {
return LmUser.keys.id.eq(userId())
}),
DataStoreSyncExpression.syncExpression(LmShot.schema, where: {
return LmShot.keys.owner.eq(userId())
})
]
} |
Our team is still investigating the issue. We will provide an update as soon as we have more information. |
@harsh62 , I am also getting the issue like this: My use case is a user will be a part of multiple channels, The amplify observe query is working fine when the user is part of small number of channels. If the number of channels increases the above error is coming. |
@Krishna-Dockare would you be able to share your schema? Also if you can help me figure out what is approximately a large number of channels? |
Here is the Object from schema that we are listening to:
Here is how we are observing the object
The user can be in n number of channels. For a new user the error is not coming but when the user is logged in multiple times in multiple devices. |
Thank you - We will investigate and provide an update on this ticket. |
@thisisabhash , I have removed the group fields from auth rules from the above Object that I have mentioned. |
@Krishna-Dockare Would you be able to share how much time it is taking to load all the results? Our team will try to repro the slowness and reply to the issue as soon as we can. |
@harsh62 , It is taking around 10 seconds to fetch all the results after sign in to the Amplify. |
I get this issue as well. It appears to be when the user is not a member of any cognito groups. The resolver does n't handle that case and created a filter condition that doesn't make sense. A workaround is add all users to a default group but that is not feasible long term as the number of users grow. |
The two errors have different messages and come from different APIs. The first one
this should be the request-response of performing the SyncQuery call. We have the above schema and sync expression. The sync expressions is translated to the filter input of the sync query. We should be able to take the schema and provision the backend, and start DataStore with the syncExpression to see if we can observe the error. The second error from @Krishna-Dockare
@Krishna-Dockare, this appears to come from the subscription API call. @paulnolan7 Can you also open a new issue with the schema example and repro steps such as the API calls you are making? |
The first error is infact from the subscription request. I was able to replay the request in the AppSync console to produce the error, even without any filters (would have been the syncExpression at the DataStore client). For the schema in #3134 (comment). The LmShot model subscription request:
Response:
AppSync was provisioned with Amplify CLI version 12.10.3, transformer v2, DataStore enabled. |
@ChadyG I've created the issue referencing your schema in aws-amplify/amplify-category-api#2547 please update that issue if there is any new information you'd like to provide. @Krishna-Dockare / @paulnolan7 The errors you're seeing do seem related. Steps to reproduce will be
|
Describe the bug
Moving to GraphQL transformer v2, now getting this error when running our app against the newly deployed backend.
We added group list authorization as well as our owner authorization. The group authorization is meant to be optional, where we enable it as needed. However this seems to be incurring an error from the resolvers. I'm not sure this is exactly where the error is, I'm just getting this error on the swift client and not seeing any errors when enabling logging on the AppSync API. See log output below for (potentially) relevant request mapping log output.
Steps To Reproduce
Expected behavior
App sync continues to work after graphQL changes
Amplify Framework Version
1.30.4
Amplify Categories
API
Dependency manager
Cocoapods
Swift version
5.8.1
CLI version
12.2.4
Xcode version
15.0 b2
Relevant log output
Is this a regression?
No
Regression additional context
No response
Platforms
iOS
OS Version
iOS 16.6
Device
iPhone 13 Pro max
Specific to simulators
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: