I am building an app where permissions to various channels is dynamic based on rules in my sync function that assign users/roles to channels, etc (ok, I guess this part is obvious).
I login to the app and do a sync which pulls down a bunch of documents that currently I have permission to. Later, an admin changes my permissions such that I no longer have access to some of those docs (no longer have access to the channel they were published on).
My understanding is that after this my local database will still have docs that I no longer should have permission too. Sync won’t pull down never versions of those docs, but the local docs will still exist.
Is there a strategy for how to handle this? How do I remove docs that are already in the local database if they should no longer be synced?