Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Oops, broke TDPuller in my last commit to it :(
Browse files Browse the repository at this point in the history
  • Loading branch information
snej committed Jan 19, 2012
1 parent 038ef08 commit 08ff087
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/TDPuller.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ - (void) insertRevisions:(NSArray *)revs {
/* Updating self.lastSequence is tricky. It needs to be the received sequence ID of the revision for which we've successfully received and inserted (or rejected) it and all previous received revisions. That way, next time we can start tracking remote changes from that sequence ID and know we haven't missed anything. */
/* FIX: The current code below doesn't quite achieve that: it tracks the latest sequence ID we've successfully processed, but doesn't handle failures correctly across multiple calls to -insertRevisions. I think correct behavior will require keeping an NSMutableIndexSet to track the fake-sequences of all processed revisions; then we can find the first missing index in that set and not advance lastSequence past the revision with that fake-sequence. */

revs = [revs sortedArrayUsingSelector: @selector(compareSequences:)];
revs = [revs sortedArrayUsingComparator: ^(id array1, id array2) {
return TDSequenceCompare( [[array1 objectAtIndex: 0] sequence],
[[array2 objectAtIndex: 0] sequence]);
}];
BOOL allGood = YES;
TDPulledRevision* lastGoodRev = nil;

Expand Down

0 comments on commit 08ff087

Please sign in to comment.