I have changed my sync. formula slightly so that a specific type of documents that previously was added to the “!” channel now is not added to that channel any more. I have taken the db offline, resync’ed it, and online again.
When I sync. with the app then all of the existing documents of that type is still found in the app… Why is that? What should I do to remove them from the app if they have already been sync’ed to the app before my change to the sync. formula on the sync. gateway?
Running Couchbase Community edition 6.6, Sync. gateway 2.7 (probably should upgrade…) and CB Lite 2.8.4.
Resync doesn’t assign new sequence numbers to documents (yet… I think that’s a future opt-in enhancement).
If you want to remove a doc from a channel, you can write an update to it, which allows it to run through your new sync function and get a new sequence for clients to pull.
If the doc was explicitly removed from a channel, yes clients will recieve a removal notification and I believe it will be purged from the device (or at least a CBL notification is sent telling the app it was removed) - I’m not 100% sure on the details on the client side.
There’s another upcoming enhancement that expands on this functionality futher, to remove documents based on indirect access removal too (for example if a user lost access to a doc via a role removal).
Yup that should work - “explicitly removed” is a bit ambigouous I admit. I meant the channel is removed (not set on a mutation) from the doc, rather than something like the replicating user being removed from the channel.
Hmmm… If I change (or even delete) one of the ‘User’ documents on the server then it doesn’t replicate to the app. I tried a similar change of an attribute on another type of doc - and it replicates right away…
What am I missing…? Do I need to do a resync on the sync. gateway again???