question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-syncable models prevent SyncEngine start

See original GitHub issue

Describe 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:

  1. Init Amplify, add GQL, enable DataStore, add Codegen.
  2. Create at least 2 Models in your schema.
  3. Modify the generated schema (src/models/schema.js) and set one of the models to syncable: false
  4. Push
  5. Run your app.
  6. 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:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
abdieloucommented, Nov 18, 2020

@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…

0reactions
github-actions[bot]commented, Nov 19, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found