Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

allow non-integer sequence id's #22

Merged
merged 1 commit into from

3 participants

Gil Pedersen Howard Yeend Jason Smith
Gil Pedersen

The cloudant service uses non-integer sequence id's. This patch will enable follow to work on the service for strings as well.

Gil Pedersen

ping?

Howard Yeend
Jason Smith
Owner

Weird, I thought I merged this. Sorry.

Jason Smith jhs merged commit 65fd09e into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 28, 2012
  1. Gil Pedersen
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/feed.js
12 lib/feed.js
View
@@ -135,7 +135,13 @@ Feed.prototype.confirm = function confirm_feed() {
self.since = -1
}
- if(self.since < 0) {
+ if(self.since == -1) {
+ self.log.debug('Query since '+self.since+' will start at ' + db.update_seq)
+ self.since = db.update_seq
+ } else if(self.since < 0) {
+ if(isNaN(db.update_seq))
+ return self.emit('error', new Error('DB requires specific id in "since"'));
+
self.log.debug('Query since '+self.since+' will start at ' + (db.update_seq + self.since + 1))
self.since = db.update_seq + self.since + 1
}
@@ -512,12 +518,12 @@ Feed.prototype.on_change = function on_change(change) {
if(!change.seq)
return self.die(new Error('No seq value in change: ' + lib.JS(change)));
- if(change.seq <= self.since) {
+ if(change.seq == self.since) {
self.log.debug('Bad seq value ' + change.seq + ' since=' + self.since);
return destroy_req(self.pending.request);
}
- if(!self.caught_up && change.seq >= self.original_db_seq) {
+ if(!self.caught_up && change.seq == self.original_db_seq) {
self.caught_up = true
self.emit('catchup', change.seq)
}
Something went wrong with that request. Please try again.