{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1440","repository_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1440/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1440/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1440/events","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1440","id":176753947,"number":1440,"title":"Attachments failed to replicate when deleted and recreated","user":{"login":"sethrosetter","id":1365736,"avatar_url":"https://avatars.githubusercontent.com/u/1365736?v=3","gravatar_id":"","url":"https://api.github.com/users/sethrosetter","html_url":"https://github.com/sethrosetter","followers_url":"https://api.github.com/users/sethrosetter/followers","following_url":"https://api.github.com/users/sethrosetter/following{/other_user}","gists_url":"https://api.github.com/users/sethrosetter/gists{/gist_id}","starred_url":"https://api.github.com/users/sethrosetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethrosetter/subscriptions","organizations_url":"https://api.github.com/users/sethrosetter/orgs","repos_url":"https://api.github.com/users/sethrosetter/repos","events_url":"https://api.github.com/users/sethrosetter/events{/privacy}","received_events_url":"https://api.github.com/users/sethrosetter/received_events","type":"User","site_admin":false},"labels":[{"id":108424405,"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/backlog","name":"backlog","color":"ededed","default":false},{"id":70892163,"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/f:%20Attachment","name":"f: Attachment","color":"d7a105","default":false},{"id":33750883,"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/f:%20Replication","name":"f: Replication","color":"f8e100","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/milestones/18","html_url":"https://github.com/couchbase/couchbase-lite-ios/milestone/18","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/milestones/18/labels","id":1790899,"number":18,"title":"1.4.0","description":"Bigger than 1.3, but less than 2.0.\r\nDue date is a placeholder only.","creator":{"login":"snej","id":43241,"avatar_url":"https://avatars.githubusercontent.com/u/43241?v=3","gravatar_id":"","url":"https://api.github.com/users/snej","html_url":"https://github.com/snej","followers_url":"https://api.github.com/users/snej/followers","following_url":"https://api.github.com/users/snej/following{/other_user}","gists_url":"https://api.github.com/users/snej/gists{/gist_id}","starred_url":"https://api.github.com/users/snej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snej/subscriptions","organizations_url":"https://api.github.com/users/snej/orgs","repos_url":"https://api.github.com/users/snej/repos","events_url":"https://api.github.com/users/snej/events{/privacy}","received_events_url":"https://api.github.com/users/snej/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":12,"state":"open","created_at":"2016-05-26T21:21:21Z","updated_at":"2016-12-12T17:55:24Z","due_on":"2016-12-30T00:00:00Z","closed_at":null},"comments":5,"created_at":"2016-09-13T21:24:46Z","updated_at":"2016-12-13T02:02:40Z","closed_at":null,"body":"This also fails with Android (1.3.1-30) and .NET (1.3.1-13)\n\nFailing test - https://github.com/couchbaselabs/mobile-testkit/blob/feature/add-multiple-sg-replication-test/testsuites/listener/shared/client_sg/attachments.py#L14-L86\n\nSteps to reproduce:\n1. Start continuous replication between LiteServ and Sync Gateway\n2. Add a few docs with large attachements to LiteServ\n3. Immediately after delete the docs on LiteServ\n4. Recreate the docs on LiteServ with the same id and attachment (rev = 3-xxxxx)\n5. The recreated attachement docs do not sync to sync gateway\n\nExpected: Recreated attachment docs would sync\nActual: They do not\n\nI am seeing these errors in the logs\n\n```\n14:21:50.655‖ WARNING: CBLRestPusher[http://192.168.0.49:4985/db]: _bulk_docs got an error: {\n    error = \"bad_request\";\n    id = \"large_attach_0\";\n    reason = \"Missing digest in stub attachment \\\"golden_gate_large.jpg\\\"\";\n    status = 400;\n} {at __40-[CBLRestPusher uploadBulkDocs:changes:]_block_invoke:402}\n14:21:50.655‖ WARNING: CBLRestPusher[http://192.168.0.49:4985/db]: _bulk_docs got an error: {\n    error = \"bad_request\";\n    id = \"large_attach_1\";\n    reason = \"Missing digest in stub attachment \\\"golden_gate_large.jpg\\\"\";\n    status = 400;\n```\n\n---\n- Version:   1.3.1-6\n- Client OS: Mac OSX\n- Server:    Sync Gateway 1.3.1-16\n"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/comments/266613613","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1440#issuecomment-266613613","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1440","id":266613613,"user":{"login":"borrrden","id":2470288,"avatar_url":"https://avatars.githubusercontent.com/u/2470288?v=3","gravatar_id":"","url":"https://api.github.com/users/borrrden","html_url":"https://github.com/borrrden","followers_url":"https://api.github.com/users/borrrden/followers","following_url":"https://api.github.com/users/borrrden/following{/other_user}","gists_url":"https://api.github.com/users/borrrden/gists{/gist_id}","starred_url":"https://api.github.com/users/borrrden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borrrden/subscriptions","organizations_url":"https://api.github.com/users/borrrden/orgs","repos_url":"https://api.github.com/users/borrrden/repos","events_url":"https://api.github.com/users/borrrden/events{/privacy}","received_events_url":"https://api.github.com/users/borrrden/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T02:02:40Z","updated_at":"2016-12-13T02:02:40Z","body":"Analysis:  The following sequence triggers this behavior:\r\n\r\n1) PUT document with attachment\r\n2) DELETE document\r\n3) PUT document with attachment *and no rev-id*\r\n\r\nIn particular the third call without the revid causes the process attachments method to get a `nil` previous revision and default to generation 1"}}
{"actor":{"display_login":"borrrden"}}