Is there a way to debug sync rules?
A good way to debug sync rules would be to open up the console and run some tests on the object counts. For example, if you are archiving the user
object and syncing all users except for the archived ones, you can compare the backend data browser count to what is returned in-app for:
await DB.user.all().count();
–> This should return only users where archived != true
await OnlineDB.user.where(archived != ?, true).count();
–> this will return the count that you are expecting
If those counts don’t look correct, I suggest diving into the sync rules definitions to make sure that the user
object in this example is not synced in an additional bucket without the archiving condition rule in place. I also suggest checking that your current user role and/or permissions are set up correctly with the sync rules you are testing.