Skip to content
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

Wrong return code for listener causes problems with puller and deleted items #1750

Closed
djpongh opened this issue May 10, 2017 · 2 comments
Closed
Labels
Milestone

Comments

@djpongh
Copy link

djpongh commented May 10, 2017

From couchbase/couchbase-lite-net#850

Sync Gateway will return 200 with a small body when a deleted revision is requested by ID, but CBL will return 404 with "reason: deleted". This will cause a puller to skip this revision and never delete a document locally if it happens to get into a non-bulk pull request. The simple test case from a forum post seem to be start up instances, one with a listener running and the other with continuous push and pull, and then add a document to the listener side and subsequently delete it with enough delay in between to ensure that both end up requesting the document directly. This logic appears to affect Objective-C as well, but I have not checked Java.

@djpongh djpongh added this to the 1.4.1 milestone May 10, 2017
@djpongh djpongh added icebox and removed backlog labels Jun 9, 2017
pasin added a commit that referenced this issue Sep 28, 2017
When getting a deleted doc with revid, need to return status OK with doc info and _deleted = true.

#1750
pasin added a commit that referenced this issue Sep 28, 2017
When getting a deleted doc with revid, need to return status OK with doc info and _deleted = true.

#1750
pasin added a commit that referenced this issue Sep 29, 2017
Update the unit test to verify the result of getting the deleted rev.

#1750
@pasin
Copy link
Contributor

pasin commented Sep 29, 2017

It turned out that iOS doesn't have same issue as .NET and Android.

@borrrden and @hideki could you please review again why the fix is needed for the platform as the code looks pretty similar in that area?

@pasin pasin closed this as completed Sep 29, 2017
@pasin pasin removed the icebox label Sep 29, 2017
@borrrden
Copy link
Member

There is an extra part in .NET which returns null for a delete revision from the SQLite store. I'm not sure why, as iOS does not do this. It looks like I did this in order to get the correct return code for the deleted document in the first place (couchbase/couchbase-lite-net#806)

@djpongh djpongh removed the bug label Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants