{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5518","repository_url":"https://api.github.com/repos/pouchdb/pouchdb","labels_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5518/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5518/comments","events_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5518/events","html_url":"https://github.com/pouchdb/pouchdb/issues/5518","id":168536739,"number":5518,"title":"Bad handling of credentials on Android 6.0","user":{"login":"danielo515","id":2270425,"avatar_url":"https://avatars.githubusercontent.com/u/2270425?v=3","gravatar_id":"","url":"https://api.github.com/users/danielo515","html_url":"https://github.com/danielo515","followers_url":"https://api.github.com/users/danielo515/followers","following_url":"https://api.github.com/users/danielo515/following{/other_user}","gists_url":"https://api.github.com/users/danielo515/gists{/gist_id}","starred_url":"https://api.github.com/users/danielo515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielo515/subscriptions","organizations_url":"https://api.github.com/users/danielo515/orgs","repos_url":"https://api.github.com/users/danielo515/repos","events_url":"https://api.github.com/users/danielo515/events{/privacy}","received_events_url":"https://api.github.com/users/danielo515/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pouchdb/pouchdb/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/pouchdb/pouchdb/labels/needs%20reproducing","name":"needs reproducing","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-07-31T20:32:11Z","updated_at":"2016-08-02T10:22:35Z","closed_at":null,"body":"### Environment (Node.js/browser/hybrid app/etc.)\r\n\r\nBrowser.  PouchDB 3.4.1-prerelease\r\n\r\n### Browser/platform (Chrome/FF/Safari/Edge/iOS/Android/etc.)\r\n\r\nAndroid Browser. Version 51.0.2704.81\r\n\r\n### Adapter (IndexedDB/WebSQL/LevelDB/etc.)\r\n\r\nI think it is using IndexedDB, because I'm not using any plugin.\r\n\r\n### Server (CouchDB/Cloudant/Couchbase/PouchDB Server/etc.)\r\n\r\nCloudant\r\n\r\n### Please describe your issue. Test cases (e.g. JSBin) are very helpful!\r\n\r\nOn Android 6.0 seems that Pouch is not managing correctly the credentials. Looking at the debugger console it tries to start syncing before asking for credentials. On any other platform ,PC browser, 'Android 4.4' (chrome or firefox) it works fine, it first asks for credentials, and then it tries to start syncing. \r\nBut on Android 6.0 I get an error 500 even before I can write my username and password. Here is the exact error:\r\n\r\n```js\r\no {status: 500, name: \"unknown_error\", \r\n    message: \"Database encountered an unknown error\", error: true}\r\n```\r\n\r\nIf I inspect the network tab of the dev tools I can see olny one request, and it is not even to cloudant, it's to `blob:content%3A///...`\r\n\r\nI have the same problem with firefox, and I tried have disabled the Data Saver."},"comment":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/comments/236864594","html_url":"https://github.com/pouchdb/pouchdb/issues/5518#issuecomment-236864594","issue_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5518","id":236864594,"user":{"login":"danielo515","id":2270425,"avatar_url":"https://avatars.githubusercontent.com/u/2270425?v=3","gravatar_id":"","url":"https://api.github.com/users/danielo515","html_url":"https://github.com/danielo515","followers_url":"https://api.github.com/users/danielo515/followers","following_url":"https://api.github.com/users/danielo515/following{/other_user}","gists_url":"https://api.github.com/users/danielo515/gists{/gist_id}","starred_url":"https://api.github.com/users/danielo515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielo515/subscriptions","organizations_url":"https://api.github.com/users/danielo515/orgs","repos_url":"https://api.github.com/users/danielo515/repos","events_url":"https://api.github.com/users/danielo515/events{/privacy}","received_events_url":"https://api.github.com/users/danielo515/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T10:22:35Z","updated_at":"2016-08-02T10:22:35Z","body":">pouchdb-authentication allows you to use cookie authentication and login/logout without recreating the PouchDB object.\r\n\r\nThat is very convenient. I have to admit that it is very tempting to use the library, but I'm not sure if I want to pay 40k extra on the weight of the application. \r\n\r\n> It also has methods for creating/managing users (which may be superfluous to you).\r\n\r\nIt is at this point, but I have plans to provide a storage service, so maybe managing users would come in handy.\r\n\r\n>Alternatively, you can always just make a http request to https://myaccount.cloudant.com/_session using JavaScript to sign in the user using cookie auth.\r\n\r\nAnd rely on browser prompt? This will require to wait the user to log in, and then once the cookie is set create the remote DB and start sync, right?"}}
{"actor":{"display_login":"danielo515"}}