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
[WARN] 18:15.415 DataStore - subscriptionError Connection failed: #12473
Comments
Hi @MeryAmun 👋 thank you for raising this issue.
Based on the error message, it seems that Conflict Detection may not be enabled. The You can check by running If it's already enabled, then try running Also, as a side note, I'd like to mention that unless you have a specific requirement for offline capabilities in your application, we recommend using the API library to perform GraphQL requests with the best balance of performance and reliability. |
Hi @chrisbonifacio Thank you for taking out your time to respond to my query.I checked and it was disabled. can tou please give me a run down on how to get it eneabled and the best resolution strategy. Thank you again. I had abandoned a previous project because of this same problem and I was already thinking of quitting AWS Amplify. |
Hi @MeryAmun. Happy to help! Auto Merge should be fine as a default for most use cases. For more info on how the strategies work: |
@MeryAmun let me know if those steps fixed the original issue for you! |
@chrisbonifacio I followed you but didn't work i have the same issue |
Hi @MeryAmun it sounds like DataStore is trying to sync down some records that might've been created before it was enabled, so they do not have those fields, causing the error. You will have to either delete those records in DynamoDB (if in a dev environment) or backfill them with values for those fields. _version can be set to 1, _deleted can be false, and _lastChangedAt can be set to an arbitrary date. |
@MeryAmun and @Abdullah47744, can you let us know if following the instructions above from @chrisbonifacio help resolve the issue? Thanks. |
Yes helpfull
…On Mon, Dec 4, 2023 at 5:49 PM Ahmed Shams Saif ***@***.***> wrote:
@MeryAmun <https://github.com/MeryAmun> let me know if those steps fixed
the original issue for you!
Hey @MeryAmun <https://github.com/MeryAmun> I followed your instructions
and it worked! Thanks!!
—
Reply to this email directly, view it on GitHub
<#12473 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7SSL3OCTCKYYHVRAYNDHW3YHXBERAVCNFSM6AAAAAA6WZ27HCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZYGU3DONBQGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@chrisbonifacio thank you for your explanation of the solution. For others, if you did your Amplify model creation via Amplify Studio, you can resolve this issue by:
Hope that helps. |
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
DataStore, Interactions
Amplify Categories
storage, api, interactions
Environment information
Describe the bug
when I try to fetch the list of users available in the Data store, I get an empty array, despite the fact that I have 3 users currently in the store
Expected behavior
display data from AWS amplify after running Datastore.query(User).then(setUsers)
Reproduction steps
Code Snippet
// Put your logs below this line
WARN [WARN] 18:15.415 DataStore - subscriptionError Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'User' is undefined @ 'onUpdateUser/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'User' is undefined @ 'onUpdateUser/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'User' is undefined @ 'onUpdateUser/_deleted'"}]}
WARN [WARN] 18:15.471 DataStore {"cause": {"error": {"errors": [Array]}, "provider": {"_config": [Object], "awsRealTimeSocket": [WebSocket], "connectionState": "Connecting", "connectionStateMonitor": [ConnectionStateMonitor], "connectionStateMonitorSubscription": [Subscription], "keepAliveAlertTimeoutId": 470, "keepAliveTimeout": 300000, "keepAliveTimeoutId": 469, "promiseArray": [Array], "reconnectionMonitor": [ReconnectionMonitor], "socketStatus": 1, "subscriptionObserverMap": [Map]}}, "errorType": "Unknown", "localModel": null, "message": "Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'User' is undefined @ 'onUpdateUser/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'User' is undefined @ 'onUpdateUser/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'User' is undefined @ 'onUpdateUser/_deleted'"}]}", "model": "User", "operation": "Update", "process": "subscribe", "recoverySuggestion": "Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues", "remoteModel": null}
WARN [WARN] 25:13.66 DataStore {"cause": {"data": null, "errors": [[Object], [Object]]}, "errorType": "Unknown", "localModel": null, "message": undefined, "model": "Post", "operation": null, "process": "sync", "recoverySuggestion": "Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues", "remoteModel": null}
WARN [WARN] 25:13.608 DataStore {"cause": {"data": null, "errors": [[Object], [Object]]}, "errorType": "Unknown", "localModel": null, "message": undefined, "model": "User", "operation": null, "process": "sync", "recoverySuggestion": "Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues", "remoteModel": null}
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: