-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBLReplicator.isDocumentPending is inaccurate when replicator is offline #1132
Comments
Seems like the replicator isn't considering anything as pending while it's in the offline state. I wonder why... |
Oh, actually it's a simple logic error in CBLReplication. It keeps a cached set of |
It would be more efficient for CBLReplication to cache the push replicator's lastSequence (an integer.) Then it can implement
|
That sounds familiar .. from your previous comment #442 (comment):
|
Now tracking replicator's lastSequence and caching it in an ivar. -isDocumentPending: just compares the doc's sequence with that. pendingDocumentIDs does basically what it used to do, but it doesn't need to do it on a background thread. Also, the bug-fix portion of this is that pendingDocumentIDs remembers the database's lastSequenceNumber when it's cached; if that changes, the cached value is invalidated. Fixes #1132
Now tracking replicator's lastSequence and caching it in an ivar. -isDocumentPending: just compares the doc's sequence with that. pendingDocumentIDs does basically what it used to do, but it doesn't need to do it on a background thread. Also, the bug-fix portion of this is that pendingDocumentIDs remembers the database's lastSequenceNumber when it's cached; if that changes, the cached value is invalidated. Fixes #1132
It seems like
isDocumentPending
might not be working as one would expect it to when a device is completely offline.Setup to reproduce
Follow these instructions in order to use Apple's "Network Link Conditioner" to test different connectivity qualities on both the simulator and on actual physical iOS devices.
In the ToDoLite-iOS project, change the
kSyncGatewayUrl
inAppDelegate.m
if need be. Also, make sure that theFacebookAppID
andURL Scheme
inInfo.plist
is usable/accurate as well.Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: