{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1313","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1313/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1313/comments","events_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1313/events","html_url":"https://github.com/couchbase/sync_gateway/issues/1313","id":118715808,"number":1313,"title":"accept _local docs in _bulk_docs post","user":{"login":"jchris","id":253,"avatar_url":"https://avatars.githubusercontent.com/u/253?v=3","gravatar_id":"","url":"https://api.github.com/users/jchris","html_url":"https://github.com/jchris","followers_url":"https://api.github.com/users/jchris/followers","following_url":"https://api.github.com/users/jchris/following{/other_user}","gists_url":"https://api.github.com/users/jchris/gists{/gist_id}","starred_url":"https://api.github.com/users/jchris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchris/subscriptions","organizations_url":"https://api.github.com/users/jchris/orgs","repos_url":"https://api.github.com/users/jchris/repos","events_url":"https://api.github.com/users/jchris/events{/privacy}","received_events_url":"https://api.github.com/users/jchris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/couchbase/sync_gateway/milestones/16","html_url":"https://github.com/couchbase/sync_gateway/milestones/1.3","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/milestones/16/labels","id":1267127,"number":16,"title":"1.3","description":"","creator":{"login":"zgramana","id":759830,"avatar_url":"https://avatars.githubusercontent.com/u/759830?v=3","gravatar_id":"","url":"https://api.github.com/users/zgramana","html_url":"https://github.com/zgramana","followers_url":"https://api.github.com/users/zgramana/followers","following_url":"https://api.github.com/users/zgramana/following{/other_user}","gists_url":"https://api.github.com/users/zgramana/gists{/gist_id}","starred_url":"https://api.github.com/users/zgramana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zgramana/subscriptions","organizations_url":"https://api.github.com/users/zgramana/orgs","repos_url":"https://api.github.com/users/zgramana/repos","events_url":"https://api.github.com/users/zgramana/events{/privacy}","received_events_url":"https://api.github.com/users/zgramana/received_events","type":"User","site_admin":false},"open_issues":67,"closed_issues":4,"state":"open","created_at":"2015-08-22T00:09:34Z","updated_at":"2016-01-29T05:18:00Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-11-24T22:18:47Z","updated_at":"2016-01-31T21:24:37Z","closed_at":"2015-12-11T17:18:39Z","body":"PouchDB 5.1 does this, and there's no reason we shouldn't accept it.\r\n\r\nCode will  require reusing some of the logic from  `handleGetLocalDoc` and `handlePutLocalDoc` in the places that currently call `realDocID`."},"comment":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/comments/177616827","html_url":"https://github.com/couchbase/sync_gateway/issues/1313#issuecomment-177616827","issue_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1313","id":177616827,"user":{"login":"colinjlacy","id":4993605,"avatar_url":"https://avatars.githubusercontent.com/u/4993605?v=3","gravatar_id":"","url":"https://api.github.com/users/colinjlacy","html_url":"https://github.com/colinjlacy","followers_url":"https://api.github.com/users/colinjlacy/followers","following_url":"https://api.github.com/users/colinjlacy/following{/other_user}","gists_url":"https://api.github.com/users/colinjlacy/gists{/gist_id}","starred_url":"https://api.github.com/users/colinjlacy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinjlacy/subscriptions","organizations_url":"https://api.github.com/users/colinjlacy/orgs","repos_url":"https://api.github.com/users/colinjlacy/repos","events_url":"https://api.github.com/users/colinjlacy/events{/privacy}","received_events_url":"https://api.github.com/users/colinjlacy/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T21:24:37Z","updated_at":"2016-01-31T21:24:37Z","body":"I'm still having this problem on the latest commit of sync_gateway, b52642fd95c46838ffd96b3d2e2983647b7597b5, when used with PouchDB 5.2.1.  Here's the SG console output:\r\n```\r\n2016-01-31T15:04:29.787-06:00 Starting admin server on 127.0.0.1:4985\r\n2016-01-31T15:04:29.790-06:00 Starting server on :4984 ...\r\n2016-01-31T15:04:34.173-06:00 HTTP:  #001: GET /pouch/\r\n2016-01-31T15:04:34.185-06:00 HTTP:  #002: GET /pouch/\r\n2016-01-31T15:04:34.207-06:00 HTTP:  #003: GET /\r\n2016-01-31T15:04:34.207-06:00 HTTP:  #004: GET /\r\n2016-01-31T15:04:34.211-06:00 HTTP:  #005: GET /\r\n2016-01-31T15:04:34.212-06:00 HTTP:  #006: GET /\r\n2016-01-31T15:04:34.346-06:00 HTTP:  #007: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:34.346-06:00 HTTP: #007:     --> 404 missing  (0.5 ms)\r\n2016-01-31T15:04:34.351-06:00 HTTP:  #008: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:34.351-06:00 HTTP: #008:     --> 404 missing  (0.5 ms)\r\n2016-01-31T15:04:34.353-06:00 HTTP:  #009: GET /pouch/_local/AcooQbMLLrfGAJcmoArYzw==\r\n2016-01-31T15:04:34.353-06:00 HTTP: #009:     --> 404 missing  (0.4 ms)\r\n2016-01-31T15:04:34.358-06:00 HTTP:  #010: GET /pouch/_local/AcooQbMLLrfGAJcmoArYzw==\r\n2016-01-31T15:04:34.358-06:00 HTTP: #010:     --> 404 missing  (0.5 ms)\r\n2016-01-31T15:04:34.362-06:00 HTTP:  #011: OPTIONS /pouch/_bulk_docs\r\n2016-01-31T15:04:34.383-06:00 HTTP:  #012: OPTIONS /pouch/_bulk_docs\r\n2016-01-31T15:04:34.384-06:00 HTTP:  #013: POST /pouch/_bulk_docs\r\n2016-01-31T15:04:34.384-06:00 \tBulkDocs: Doc \"_local/AcooQbMLLrfGAJcmoArYzw==\" --> 400 Invalid doc ID (400 Invalid doc ID)\r\n2016-01-31T15:04:34.391-06:00 HTTP:  #014: POST /pouch/_bulk_docs\r\n2016-01-31T15:04:34.391-06:00 \tBulkDocs: Doc \"_local/AcooQbMLLrfGAJcmoArYzw==\" --> 400 Invalid doc ID (400 Invalid doc ID)\r\n2016-01-31T15:04:34.401-06:00 HTTP:  #015: GET /pouch/_changes?timeout=25000&style=all_docs&heartbeat=10000&since=2&limit=100\r\n2016-01-31T15:04:34.401-06:00 HTTP:  #016: GET /pouch/_changes?timeout=25000&style=all_docs&heartbeat=10000&since=2&limit=100\r\n2016-01-31T15:04:34.401-06:00 Changes: MultiChangesFeed({*}, {Since:2 Limit:100 Conflicts:true IncludeDocs:false Wait:false Continuous:false Terminator:0xc2080c53e0 HeartbeatMs:25000 TimeoutMs:25000}) ... \r\n2016-01-31T15:04:34.402-06:00 Changes: MultiChangesFeed({*}, {Since:2 Limit:100 Conflicts:true IncludeDocs:false Wait:false Continuous:false Terminator:0xc208160300 HeartbeatMs:25000 TimeoutMs:25000}) ... \r\n2016-01-31T15:04:34.402-06:00 Changes+: MultiChangesFeed: channels expand to channels.TimedSet{\"!\":0x1, \"*\":0x1} ... \r\n2016-01-31T15:04:34.402-06:00 Changes+: MultiChangesFeed: channels expand to channels.TimedSet{\"!\":0x1, \"*\":0x1} ... \r\n2016-01-31T15:04:34.406-06:00 HTTP:  #017: OPTIONS /pouch/_revs_diff\r\n2016-01-31T15:04:34.408-06:00 HTTP:  #018: OPTIONS /pouch/_revs_diff\r\n2016-01-31T15:04:34.413-06:00 HTTP:  #019: POST /pouch/_revs_diff\r\n2016-01-31T15:04:34.413-06:00 HTTP:  #020: POST /pouch/_revs_diff\r\n2016-01-31T15:04:34.423-06:00 HTTP:  #021: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:34.423-06:00 HTTP: #021:     --> 404 missing  (0.4 ms)\r\n2016-01-31T15:04:34.426-06:00 HTTP:  #022: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:34.426-06:00 HTTP: #022:     --> 404 missing  (0.4 ms)\r\n2016-01-31T15:04:34.428-06:00 HTTP:  #023: OPTIONS /pouch/_bulk_docs\r\n2016-01-31T15:04:34.432-06:00 HTTP:  #024: OPTIONS /pouch/_bulk_docs\r\n2016-01-31T15:04:34.433-06:00 HTTP:  #025: POST /pouch/_bulk_docs\r\n2016-01-31T15:04:34.433-06:00 \tBulkDocs: Doc \"_local/Bm.uEatlKza8kO878DZy2A==\" --> 400 Invalid doc ID (400 Invalid doc ID)\r\n2016-01-31T15:04:34.436-06:00 HTTP:  #026: POST /pouch/_bulk_docs\r\n2016-01-31T15:04:34.436-06:00 \tBulkDocs: Doc \"_local/Bm.uEatlKza8kO878DZy2A==\" --> 400 Invalid doc ID (400 Invalid doc ID)\r\n2016-01-31T15:04:34.444-06:00 Changes: MultiChangesFeed done \r\n2016-01-31T15:04:34.444-06:00 Changes: MultiChangesFeed done \r\n2016-01-31T15:04:34.464-06:00 HTTP:  #027: GET /pouch/\r\n2016-01-31T15:04:34.464-06:00 HTTP:  #028: GET /pouch/_changes?timeout=25000&style=all_docs&feed=longpoll&heartbeat=10000&since=2&limit=100\r\n2016-01-31T15:04:34.464-06:00 Changes: MultiChangesFeed({*}, {Since:2 Limit:100 Conflicts:true IncludeDocs:false Wait:true Continuous:false Terminator:0xc2080618c0 HeartbeatMs:25000 TimeoutMs:25000}) ... \r\n2016-01-31T15:04:34.464-06:00 Changes+: MultiChangesFeed: channels expand to channels.TimedSet{\"!\":0x1, \"*\":0x1} ... \r\n2016-01-31T15:04:34.464-06:00 Changes+: MultiChangesFeed waiting... \r\n2016-01-31T15:04:34.464-06:00 Changes+: Waiting for \"pouch\"'s count to pass 0\r\n2016-01-31T15:04:34.467-06:00 HTTP:  #029: GET /pouch/\r\n2016-01-31T15:04:34.468-06:00 HTTP:  #030: GET /pouch/_changes?timeout=25000&style=all_docs&feed=longpoll&heartbeat=10000&since=2&limit=100\r\n2016-01-31T15:04:34.469-06:00 Changes: MultiChangesFeed({*}, {Since:2 Limit:100 Conflicts:true IncludeDocs:false Wait:true Continuous:false Terminator:0xc208061ec0 HeartbeatMs:25000 TimeoutMs:25000}) ... \r\n2016-01-31T15:04:34.469-06:00 Changes+: MultiChangesFeed: channels expand to channels.TimedSet{\"!\":0x1, \"*\":0x1} ... \r\n2016-01-31T15:04:34.469-06:00 Changes+: MultiChangesFeed waiting... \r\n2016-01-31T15:04:34.469-06:00 Changes+: Waiting for \"pouch\"'s count to pass 0\r\n2016-01-31T15:04:35.841-06:00 HTTP:  #031: GET /\r\n2016-01-31T15:04:35.845-06:00 HTTP:  #032: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:35.845-06:00 HTTP: #032:     --> 404 missing  (0.5 ms)\r\n2016-01-31T15:04:35.853-06:00 HTTP:  #033: OPTIONS /pouch/_revs_diff\r\n2016-01-31T15:04:35.856-06:00 HTTP:  #034: POST /pouch/_revs_diff\r\n2016-01-31T15:04:35.862-06:00 HTTP:  #035: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:35.862-06:00 HTTP: #035:     --> 404 missing  (0.4 ms)\r\n2016-01-31T15:04:35.866-06:00 HTTP:  #036: OPTIONS /pouch/_bulk_docs\r\n2016-01-31T15:04:35.868-06:00 HTTP:  #037: POST /pouch/_bulk_docs\r\n2016-01-31T15:04:35.868-06:00 \tBulkDocs: Doc \"_local/Bm.uEatlKza8kO878DZy2A==\" --> 400 Invalid doc ID (400 Invalid doc ID)\r\n2016-01-31T15:04:35.960-06:00 HTTP:  #038: GET /\r\n2016-01-31T15:04:35.964-06:00 HTTP:  #039: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:35.964-06:00 HTTP: #039:     --> 404 missing  (0.5 ms)\r\n2016-01-31T15:04:35.970-06:00 HTTP:  #040: OPTIONS /pouch/_revs_diff\r\n2016-01-31T15:04:35.973-06:00 HTTP:  #041: POST /pouch/_revs_diff\r\n2016-01-31T15:04:35.978-06:00 HTTP:  #042: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:35.978-06:00 HTTP: #042:     --> 404 missing  (0.4 ms)\r\n2016-01-31T15:04:35.981-06:00 HTTP:  #043: OPTIONS /pouch/_bulk_docs\r\n2016-01-31T15:04:35.983-06:00 HTTP:  #044: POST /pouch/_bulk_docs\r\n2016-01-31T15:04:35.984-06:00 \tBulkDocs: Doc \"_local/Bm.uEatlKza8kO878DZy2A==\" --> 400 Invalid doc ID (400 Invalid doc ID)\r\n2016-01-31T15:04:37.236-06:00 HTTP:  #045: GET /\r\n2016-01-31T15:04:37.240-06:00 HTTP:  #046: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:37.241-06:00 HTTP: #046:     --> 404 missing  (0.5 ms)\r\n2016-01-31T15:04:37.247-06:00 HTTP:  #047: OPTIONS /pouch/_revs_diff\r\n2016-01-31T15:04:37.250-06:00 HTTP:  #048: POST /pouch/_revs_diff\r\n2016-01-31T15:04:37.254-06:00 HTTP:  #049: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n2016-01-31T15:04:37.261-06:00 HTTP: #049:     --> 404 missing  (6.9 ms)\r\n2016-01-31T15:04:37.264-06:00 HTTP:  #050: OPTIONS /pouch/_bulk_docs\r\n2016-01-31T15:04:37.266-06:00 HTTP:  #051: POST /pouch/_bulk_docs\r\n2016-01-31T15:04:37.267-06:00 \tBulkDocs: Doc \"_local/Bm.uEatlKza8kO878DZy2A==\" --> 400 Invalid doc ID (400 Invalid doc ID)\r\n2016-01-31T15:04:37.453-06:00 HTTP:  #052: GET /\r\n2016-01-31T15:04:37.458-06:00 HTTP:  #053: GET /pouch/_local/Bm.uEatlKza8kO878DZy2A==\r\n```\r\nAnd it goes on like that indefinitely.  I'm running a simple config based on the one posted in this [blog post](http://blog.couchbase.com/sync-with-couchbase-using-only-angularjs-and-pouchdb):\r\n```\r\n{\r\n  \"log\": [\r\n    \"CRUD+\",\r\n    \"REST+\",\r\n    \"Changes+\",\r\n    \"Attach+\"\r\n  ],\r\n  \"databases\": {\r\n    \"pouch\": {\r\n      \"server\": \"http://localhost:8091\",\r\n      \"sync\": \"function (doc) {channel (doc.channels);}\",\r\n      \"users\": {\r\n        \"GUEST\": {\r\n          \"disabled\": false,\r\n          \"admin_channels\": [\r\n            \"*\"\r\n          ]\r\n        }\r\n      }\r\n    }\r\n  },\r\n  \"CORS\": {\r\n    \"Origin\": [\r\n      \"http://localhost:8100\"\r\n    ],\r\n    \"LoginOrigin\": [\r\n      \"http://localhost:8100\"\r\n    ],\r\n    \"Headers\": [\r\n      \"Content-Type\"\r\n    ],\r\n    \"MaxAge\": 17280000\r\n  }\r\n}\r\n```\r\nI also updated to Couchbase Server 4.1.  \r\n\r\nI'm definitely getting synchronized data.  I've got a simple todo list that I've built in Ionic running in Chrome 48 and Firefox 43.  Updates in one are successfully reflected in the other.  \r\n\r\nAny chance I'm missing something - missing an update, or have a poorly configured connection somewhere?"}}