CouchChat-iOS demo: The way to remove all the docs on all mobiles?

29 views
Skip to first unread message

Guofeng Zhang

unread,
Oct 16, 2014, 11:50:02 AM10/16/14
to mobile-c...@googlegroups.com
Hi,

Suggested I create a chat rooms and have chatted with a several users.

Now I want to close the chat rooms and also want to the synced docs on any mobile that has synced to to be removed completely. Note that I also want to remove the chat room too.

I cannot figure out how to do it. Your help is appreciated.

Thanks for you help. 

Jens Alfke

unread,
Oct 16, 2014, 12:51:06 PM10/16/14
to mobile-c...@googlegroups.com

On Oct 16, 2014, at 4:43 AM, Guofeng Zhang <guof...@gmail.com> wrote:

Now I want to close the chat rooms and also want to the synced docs on any mobile that has synced to to be removed completely. Note that I also want to remove the chat room too.

In the CouchChat example, if you delete the chat room document, everyone loses access to the channel that the chat message documents are in, and the chat will no longer show up in the UI because its document is gone. But the messages remain.

Currently, the client is not notified when it loses access to a channel, and it doesn't delete the documents.  This is appropriate in some situations (my analogy is that "if your subscription to the New Yorker expires, they don't come to your house and take away your magazines"), but many developers have asked for the local docs to be deleted. 

There's an issue in Sync Gateway tracking this (I'm offline right now so I can't look up a link) and I've done some implementation work, but it's actually a tough problem due to the way channels are implemented. We're hoping to add this in a future release.

—Jens

Guofeng Zhang

unread,
Oct 16, 2014, 9:51:12 PM10/16/14
to mobile-c...@googlegroups.com

When I remove a chat room, I do it this way:
     1. remove all the message docs in the chat room,
      2. then remove the chat room doc.

From the definition of the Syn Function, I think this could remove the message docs and chat room docs on all the related mobiles, right? Is there any other issue with this way I did not think of?

Thanks for your quick response.

Guofeng


--
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 mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/191C54C4-24AA-45CC-98C0-F222F4CAD386%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Jens Alfke

unread,
Oct 17, 2014, 1:16:27 AM10/17/14
to mobile-c...@googlegroups.com

On Oct 16, 2014, at 6:51 PM, Guofeng Zhang <guof...@gmail.com> wrote:

From the definition of the Syn Function, I think this could remove the message docs and chat room docs on all the related mobiles, right?

Right. Even without a sync function, deleting a document will delete it on all synced devices.
The sync function is (hopefully) just stopping someone who doesn't have permission to delete the room or messages.

—Jens

Reply all
Reply to author
Forward
0 new messages