Granting access to a channel & backfills

When I grant user access to a new channel, he get’s a backfill for the channel, which includes documents that have been previously removed from that channel. ( they show up as removal documents in his _changes feed )

In a simplified version of my use case -

  • documents are added to ‘active’ channel , then at some point later removed.
  • (some) users need to be given access to this active channel so they get the currently active documents synced down.

The issue is, after a period of operation, the backfill of removed documents ( if they are since the beginning of time) will dwarf the actual data.

Does Sync Gateway do something to limit this? I’ve only tested a small amount, but it does seem to always backfill from the beginning of time for a new access grant.


Just to follow up on this,

I am using the REST api directly, no CBL involved.

I do have a workaround, ( use an explicit channel list, keep track of channels client side, use an active_only query to catch up to any new channels )

Just wondering if this should be filed as an issue ? afaict the backfill of removed docs will grow without bound, but maybe I am missing something.

This shouldn’t be the case - during backfill, I don’t believe Sync Gateway should be sending removal notifications.

I’ve filed to investigate this.