Non-syncable models prevent SyncEngine start
See original GitHub issueDescribe the bug
Non-syncable models prevent SyncEngine start. Sync Queries are NOT generated for Non-Syncable Models, but the syncQueriesObservable
method still tries to wait on them.
This is an unusual error because Models in the generated schema (src/models/schema.js
) have the property syncable
set to true by default.
To Reproduce Steps to reproduce the behavior:
- Init Amplify, add GQL, enable DataStore, add Codegen.
- Create at least 2 Models in your schema.
- Modify the generated schema (
src/models/schema.js
) and set one of the models tosyncable: false
- Push
- Run your app.
- Although the DataStore reports “Realtime ready”, it never goes online and nothing gets synced.
Expected behavior Skip non-syncable models.
Code Snippet I think the problem is here: https://github.com/aws-amplify/amplify-js/blob/main/packages/datastore/src/sync/index.ts#L380-L401
And the solution might be to filter syncable
models.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@amhinson Sorry for the delay. You are right, it is working just fine. I could not reproduce the problem, so I’ll assume I messed up my tests.
Thanks for checking this out!
closing…
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.