Repeated changes in chenges feed continuous mode

21 views
Skip to first unread message

Martin Palatnik

unread,
Jan 30, 2015, 10:14:46 AM1/30/15
to mobile-c...@googlegroups.com
Hi, 

I'm trying to implement a feature that performs an action when something appears in the changes feed of the sync_gateway. I'm using couchbase server 2.2 and the sync_gateway HEAD in master branch. 

The issue I'm seeing is that somehow everytime I make a change, the changes feed returns all the changes and not only the change that I made.
I'm requesting the changes feed by connecting to the admin port.

Below is a link to the log.


Is this normal? Shouldn't I receive only the last change?

Thanks,
Martin

Jens Alfke

unread,
Jan 30, 2015, 1:46:03 PM1/30/15
to mobile-c...@googlegroups.com

On Jan 30, 2015, at 7:14 AM, Martin Palatnik <mar...@gmail.com> wrote:

Is this normal? Shouldn't I receive only the last change?

It's normal. HTTP is a stateless protocol, so when you make the request, the gateway has no way of knowing what changes you've already seen the last time you asked. So by default it sends you everything.

The way to get the changes since the last request is to use the "?since=" parameter in the URL. Please refer to the docs for details.

—Jens

Martin Palatnik

unread,
Jan 30, 2015, 2:00:39 PM1/30/15
to mobile-c...@googlegroups.com
Hi Jens, 

Thanks from your answer. Maybe I got something wrong but isn't conitnuous mode just for that, to open a socket and get the changes 1 by 1, by asking only once?

Thanks,
Martin

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/WHwZfAP3NEc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/30326C60-5343-4B07-B02C-84B03517758B%40couchbase.com.

For more options, visit https://groups.google.com/d/optout.

Martin Palatnik

unread,
Jan 30, 2015, 2:00:51 PM1/30/15
to mobile-c...@googlegroups.com
Hi Jens, 

Thanks from your answer. Maybe I got something wrong but isn't conitnuous mode just for that, to open a socket and get the changes 1 by 1, by asking only once?

Thanks,
Martin

Jens Alfke

unread,
Jan 30, 2015, 2:05:47 PM1/30/15
to mobile-c...@googlegroups.com

> On Jan 30, 2015, at 11:00 AM, Martin Palatnik <mar...@gmail.com> wrote:
>
> Thanks from your answer. Maybe I got something wrong but isn't conitnuous mode just for that, to open a socket and get the changes 1 by 1, by asking only once?

Yes, but each time you open the connection it'll start from the beginning (or from the ?since sequence you gave it.)

Looking at your gist again, is that all from one connection? I thought at first you were showing the output of two requests, with a blank line between. If it's all from one connection, then yes, something is wrong — it should never go backward like that. File an issue.

—Jens

Martin Palatnik

unread,
Jan 30, 2015, 2:19:23 PM1/30/15
to mobile-c...@googlegroups.com
Hi Jens,
Yes it's all from one request.
I will file an issue then.
Thanks,
Martin

Martin Palatnik

unread,
Jan 31, 2015, 8:46:32 AM1/31/15
to mobile-c...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages