{"action":"opened","issue":{"url":"https://api.github.com/repos/cloudant/couchbackup/issues/196","repository_url":"https://api.github.com/repos/cloudant/couchbackup","labels_url":"https://api.github.com/repos/cloudant/couchbackup/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/cloudant/couchbackup/issues/196/comments","events_url":"https://api.github.com/repos/cloudant/couchbackup/issues/196/events","html_url":"https://github.com/cloudant/couchbackup/issues/196","id":299324740,"number":196,"title":"Compressed _changes responses from server handled incorrectly","user":{"login":"ricellis","id":10698320,"avatar_url":"https://avatars0.githubusercontent.com/u/10698320?v=4","gravatar_id":"","url":"https://api.github.com/users/ricellis","html_url":"https://github.com/ricellis","followers_url":"https://api.github.com/users/ricellis/followers","following_url":"https://api.github.com/users/ricellis/following{/other_user}","gists_url":"https://api.github.com/users/ricellis/gists{/gist_id}","starred_url":"https://api.github.com/users/ricellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricellis/subscriptions","organizations_url":"https://api.github.com/users/ricellis/orgs","repos_url":"https://api.github.com/users/ricellis/repos","events_url":"https://api.github.com/users/ricellis/events{/privacy}","received_events_url":"https://api.github.com/users/ricellis/received_events","type":"User","site_admin":false},"labels":[{"id":581348882,"url":"https://api.github.com/repos/cloudant/couchbackup/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":{"login":"smithsz","id":5632401,"avatar_url":"https://avatars1.githubusercontent.com/u/5632401?v=4","gravatar_id":"","url":"https://api.github.com/users/smithsz","html_url":"https://github.com/smithsz","followers_url":"https://api.github.com/users/smithsz/followers","following_url":"https://api.github.com/users/smithsz/following{/other_user}","gists_url":"https://api.github.com/users/smithsz/gists{/gist_id}","starred_url":"https://api.github.com/users/smithsz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smithsz/subscriptions","organizations_url":"https://api.github.com/users/smithsz/orgs","repos_url":"https://api.github.com/users/smithsz/repos","events_url":"https://api.github.com/users/smithsz/events{/privacy}","received_events_url":"https://api.github.com/users/smithsz/received_events","type":"User","site_admin":false},"assignees":[{"login":"smithsz","id":5632401,"avatar_url":"https://avatars1.githubusercontent.com/u/5632401?v=4","gravatar_id":"","url":"https://api.github.com/users/smithsz","html_url":"https://github.com/smithsz","followers_url":"https://api.github.com/users/smithsz/followers","following_url":"https://api.github.com/users/smithsz/following{/other_user}","gists_url":"https://api.github.com/users/smithsz/gists{/gist_id}","starred_url":"https://api.github.com/users/smithsz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smithsz/subscriptions","organizations_url":"https://api.github.com/users/smithsz/orgs","repos_url":"https://api.github.com/users/smithsz/repos","events_url":"https://api.github.com/users/smithsz/events{/privacy}","received_events_url":"https://api.github.com/users/smithsz/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/cloudant/couchbackup/milestones/5","html_url":"https://github.com/cloudant/couchbackup/milestone/5","labels_url":"https://api.github.com/repos/cloudant/couchbackup/milestones/5/labels","id":3126835,"number":5,"title":"2.next","description":"","creator":{"login":"ricellis","id":10698320,"avatar_url":"https://avatars0.githubusercontent.com/u/10698320?v=4","gravatar_id":"","url":"https://api.github.com/users/ricellis","html_url":"https://github.com/ricellis","followers_url":"https://api.github.com/users/ricellis/followers","following_url":"https://api.github.com/users/ricellis/following{/other_user}","gists_url":"https://api.github.com/users/ricellis/gists{/gist_id}","starred_url":"https://api.github.com/users/ricellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricellis/subscriptions","organizations_url":"https://api.github.com/users/ricellis/orgs","repos_url":"https://api.github.com/users/ricellis/repos","events_url":"https://api.github.com/users/ricellis/events{/privacy}","received_events_url":"https://api.github.com/users/ricellis/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2018-02-19T13:07:38Z","updated_at":"2018-02-22T11:54:46Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-02-22T11:54:46Z","updated_at":"2018-02-22T11:54:46Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"- couchbackup/couchrestore version(s) that are affected by this issue.\r\n    * 2.x\r\n- Node.js version.\r\n    * Any\r\n- A sample of the code or command line statement that demonstrates the issue.\r\n   * couchbackup --url https://examples.cloudant.com --db animaldb\r\n\r\ncouchbackup 2.x uses the `Accept-Encoding: gzip` header. If the Cloudant server accepts that header and returns a compressed response the changes feed is not decompressed correctly. This results in the error:\r\n```\r\nERROR: Changes request terminated before last_seq was sent\r\n```\r\n\r\nThis is because the response stream is not decompressed automatically even though the body data on the request is, from [request](https://github.com/request/request#requestoptions-callback) documentation:\r\n>gzip - if true, add an Accept-Encoding header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. Note: Automatic decoding of the response content is performed on the body data returned through request (both through the request stream and passed to the callback function) but is not performed on the response stream (available from the response event) which is the unmodified http.IncomingMessage object which may contain compressed data. See example below."}}
{"actor":{"display_login":"ricellis"}}