Thanks Jens for the replies. As I said in my first post, I do treat the deleted documents as a special case: https://gist.github.com/jschmid/f0a4e125b9db1fd6f750 I triple-checked and I only use the "oldDoc" argument in the "if" so it should be good.
My problem now is that the clients DO NOT see the document getting updated. I put a breakpoint in the method called when kCBLReplicationChangeNotification is posted. I put a breakpoint in the view "map block", which must be called if the document is updated with "_removed" (I guess). I get nothing, no notification, nothing. It really is like the sync gateway does not propagate the deletion. >From my last post in this thread, I get a feeling that the replication is not effective anymore because the users do not have access to the channel anymore once the chatroom has been deleted. Let me share an example, with screenshots taken from the SG web admin: I have two users, two chatrooms, each chatroom has two messages. Both users have access to both channels (one channel per chatroom) <https://lh3.googleusercontent.com/-NgaFpKt1HBI/VaigZHgGfaI/AAAAAAAAsG0/WJhvmgwEWg4/s1600/Screen%2BShot%2B2015-07-17%2Bat%2B08.24.24.png> We see that each channel has one yellow document, the "chatroom" document, and two regular "messages" documents. <https://lh3.googleusercontent.com/-sX_VzCZfrIU/VaigoWn-DNI/AAAAAAAAsG8/nu6wedj6jL0/s1600/Screen%2BShot%2B2015-07-17%2Bat%2B08.24.46.png> The user1 has access to both channels. user4 also has access to them. Now I will delete a chatroom from my mobile UI. This effectively deletes the "chatroom" document. <https://lh3.googleusercontent.com/-lrCeWwTOG7Y/Vaig5XOSUGI/AAAAAAAAsHE/BJj-ii-HqJI/s1600/Screen%2BShot%2B2015-07-17%2Bat%2B08.25.35.png> We see now that there are still two channels (we kept the "messages" documents from the deleted chatroom), but one chatroom document is gone, as expected. <https://lh3.googleusercontent.com/-aX82Bto1a60/VaihJQU_QZI/AAAAAAAAsHM/b-m29nJYEQc/s1600/Screen%2BShot%2B2015-07-17%2Bat%2B08.25.48.png> But now is the problem. It appears that the user1 does not have access to the channel! Since he does not have access to the channel, he will not receive the "deleted" revision, right? I guess he must receive the "_removed" document, but that's not the case. Do I understand something wrong? Many thanks, Jonas On Thursday, July 16, 2015 at 6:12:54 PM UTC+2, Jens Alfke wrote: > > > On Jul 16, 2015, at 6:08 AM, Jonas Schmid <[email protected] > <javascript:>> wrote: > > I now understand. Since the document is deleted, the access rights it has > given are revoked and the users do not have access to the channel. > How would you update my structure so that users are notified that the > chatroom has been removed? > > > If the clients had access to the chatroom document before (which they > probably would), they’ll see it get updated; either as a deletion or as an > empty revision with “_removed”:true as the only property. > > —Jens > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/58eba66d-6cee-4533-bcd4-a42270b454d3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
