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
DataStore subscriptionProcessor failed #2734
Comments
@mvishnureddy007 You appear to be running into a limit on the AppSync side. Do you have >20 |
@tylerjroach We don't have containsAny predicate in our code. I'm providing our observer Code here QueryPredicate predicate = MessageRecipient.USER_ID.eq(ApplicationData.shared.userProfileData.getId()); Our scenario is happening because of Same user logged into multiple devices. I'm providing schema |
Even though the Android client only uses client-side filtering, the service still uses Enhanced Subscription Filtering on the service side to enforce dynamic auth rules. This rule
Gets applied service-side in the subscription auth resolver with the containsAny operator to match the groups the user is in to the groups define in the group field permittedTo. The limit is listed here. Most likely the root cause is: either some of the records have too many groups listed in the permittedTo field or the other way around, the user is a member of too many groups. I'm not exactly sure how multiple sign-in/sign-outs, or multiple devices would cause the failure. As far as I understand, the limit is per subscriber. If the explanation above doesn't help resolve the issue, please reply back with information around how Amplify is configured. How DataStore is started/stopped, and any other information you believe may be relevant, such as specific scenarios around the mentioned multiple device/sign-ins. |
If the user can be part of more than 20 groups, which is common situation in our workflow. |
There's no way to accommodate this when using AppSync subscriptions due to the way subscription filtering is implemented in the service. This is a hard limit in the service and it's not possible to increase it on a case-by-case basis. You may be able to disable subscriptions for models that use dynamic group auth ( Note that the same limit applies for a list of owners or any other dynamic, list-based row-level authorization. |
We have removed this ({allow: groups, groupsField: "permittedTo"}) Subscription is working fine. But we got another issue. ie., After every fresh login the Data store query sync is taking long time to get data from cloud.
|
@mvishnureddy007 Please update to Amplify Android 2.14.11. The last few Amplify releases have provided significant performance improvements for subscription and sync. Please report back after updating. |
After updated Amplify Android 2.14.11 also the Data store query sync is taking long time to get data from cloud. And observer query also delayed to get the real time data for user messages |
After updated Amplify Android 2.14.11 also the Data store query sync is taking long time to get data from cloud. And observer query also delayed to get the real time data for user messages |
As soon as I logged in to the app this logs I got continuously 2024-05-07 10:33:36.303 29894-30946 amplify:aws-datastore SQLCommandProcessor executeExists in 1 ms inTransaction: true SQL: SELECT EXISTS(SELECT 1 FROM ModelMetadata WHERE ModelMetadata.id = ?); Once it is finished the real time messaging and data store query is working fine with out delay Can any once help us what is the problem? How to fix it. |
Before opening, please confirm:
Language and Async Model
Java
Amplify Categories
Authentication, GraphQL API, DataStore
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
Hi,
We are getting this error after user has been logged in and out for multiple times.
DataStoreException{message=DataStore subscriptionProcessor failed to start., cause=GraphQLResponseException{message=Subscription error for MessageRecipient: [GraphQLResponse.Error{message='subscription exceeds maximum value limit 20 for operator
containsAny
.', locations='null', path='null', extensions='{errorCode=400}'}], errors=[GraphQLResponse.Error{message='subscription exceeds maximum value limit 20 for operatorcontainsAny
.', locations='null', path='null', extensions='{errorCode=400}'}], recoverySuggestion=See attached list of GraphQLResponse.Error objects.}, recoverySuggestion=Check your internet.}GraphQLResponseException{message=Subscription error for MessageRecipient: [GraphQLResponse.Error{message='subscription exceeds maximum value limit 20 for operator
containsAny
.', locations='null', path='null', extensions='{errorCode=400}'}], errors=[GraphQLResponse.Error{message='subscription exceeds maximum value limit 20 for operatorcontainsAny
.', locations='null', path='null', extensions='{errorCode=400}'}], recoverySuggestion=See attached list of GraphQLResponse.Error objects.}Reproduction steps (if applicable)
No response
Code Snippet
// Put your code below this line.
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: