Question regarding the Couchbase Sync Gateway Change Feed

47 views
Skip to first unread message

Alexander Selling

unread,
Jan 22, 2015, 12:44:26 PM1/22/15
to mobile-c...@googlegroups.com
Hi!

I've noticed that the change feed will return sequence numbers that sometimes are strings rather than integers, how come?

Sometimes they look like this -> "44444:5555"
And most of the time like this -> 123456999

Thanks in advance!

Jens Alfke

unread,
Jan 22, 2015, 2:32:16 PM1/22/15
to mobile-c...@googlegroups.com

On Jan 22, 2015, at 9:44 AM, Alexander Selling <alexande...@gmail.com> wrote:

I've noticed that the change feed will return sequence numbers that sometimes are strings rather than integers, how come?

Complicated reasons involving situations where the user gains access to a channel and thus retroactively gains access to its documents even if those documents haven't been changed recently. Those old docs will show up in the changes feed, as fake sequences, so the client knows to download them.

In general, a client has to treat remote sequences as opaque IDs; it can't make assumptions about what data type they are, or try to compare them (even for equality). They're just cookies that come back from _changes and then are sent in the next _changes request. This holds for Cloudant and BigCouch too — their sequence IDs are always long base64'd strings.

—Jens
Reply all
Reply to author
Forward
0 new messages