Permalink
Browse files

Fixed mixed-up progress counting in TDPuller

It was incrementing changesTotal too much, so it looked like replications never finished.

Also fixed a case where changesProcessed didn't get incremented upon an HTTP error.
  • Loading branch information...
1 parent 23ba222 commit 7f80adfe67a28e5ba4ab088debba204b2a4065f3 @snej snej committed May 1, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 Source/TDPuller.m
View
@@ -138,8 +138,8 @@ - (void) changeTrackerReceivedChange: (NSDictionary*)change {
[self addToInbox: rev];
[rev release];
}
- self.changesTotal += changes.count;
}
+ self.changesTotal += changes.count;
} else {
Warn(@"%@: Received invalid doc ID from _changes: %@", self, change);
}
@@ -327,6 +327,7 @@ - (void) pullBulkRevisions: (NSArray*)bulkRevs {
onCompletion:^(id result, NSError *error) {
if (error) {
self.error = error;
+ self.changesProcessed += bulkRevs.count;
} else {
// Process the resulting rows' documents.
// We only add a document if it doesn't have attachments, and if its

0 comments on commit 7f80adf

Please sign in to comment.