{"action":"created","issue":{"url":"https://api.github.com/repos/hoodiehq/hoodie/issues/612","repository_url":"https://api.github.com/repos/hoodiehq/hoodie","labels_url":"https://api.github.com/repos/hoodiehq/hoodie/issues/612/labels{/name}","comments_url":"https://api.github.com/repos/hoodiehq/hoodie/issues/612/comments","events_url":"https://api.github.com/repos/hoodiehq/hoodie/issues/612/events","html_url":"https://github.com/hoodiehq/hoodie/issues/612","id":184586866,"number":612,"title":"Error: database is destroyed","user":{"login":"gr2m","id":39992,"avatar_url":"https://avatars.githubusercontent.com/u/39992?v=3","gravatar_id":"","url":"https://api.github.com/users/gr2m","html_url":"https://github.com/gr2m","followers_url":"https://api.github.com/users/gr2m/followers","following_url":"https://api.github.com/users/gr2m/following{/other_user}","gists_url":"https://api.github.com/users/gr2m/gists{/gist_id}","starred_url":"https://api.github.com/users/gr2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gr2m/subscriptions","organizations_url":"https://api.github.com/users/gr2m/orgs","repos_url":"https://api.github.com/users/gr2m/repos","events_url":"https://api.github.com/users/gr2m/events{/privacy}","received_events_url":"https://api.github.com/users/gr2m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-21T22:52:31Z","updated_at":"2016-10-24T20:52:20Z","closed_at":null,"body":"We have a problem with sign in / sign out / sign in again and the scoped store API. Here is a script to reproduce the bug\r\n\r\n```js\r\nhoodie.account.on('signin', function () {\r\n  // logs error here\r\n  hoodie.store('conversation').findAll().then(console.log, console.log)\r\n})\r\n\r\nvar username = Math.random().toString(36).substr(2, 5)\r\nhoodie.account.signUp({username: username, password:'test'})\r\n\r\n.then(function () {\r\n  return hoodie.account.signIn({username: username, password:'test'})\r\n})\r\n\r\n.then(function () {\r\n  return hoodie.account.signOut()\r\n})\r\n\r\n.then(function () {\r\n  return hoodie.account.signIn({username: username, password:'test'})\r\n})\r\n\r\n.then(function () {\r\n  console.log('done')\r\n})\r\n```\r\n\r\nI looked into it but could not yet figure it out. Thanks to @brunopedroso you found the error"},"comment":{"url":"https://api.github.com/repos/hoodiehq/hoodie/issues/comments/255862604","html_url":"https://github.com/hoodiehq/hoodie/issues/612#issuecomment-255862604","issue_url":"https://api.github.com/repos/hoodiehq/hoodie/issues/612","id":255862604,"user":{"login":"brunopedroso","id":6763,"avatar_url":"https://avatars.githubusercontent.com/u/6763?v=3","gravatar_id":"","url":"https://api.github.com/users/brunopedroso","html_url":"https://github.com/brunopedroso","followers_url":"https://api.github.com/users/brunopedroso/followers","following_url":"https://api.github.com/users/brunopedroso/following{/other_user}","gists_url":"https://api.github.com/users/brunopedroso/gists{/gist_id}","starred_url":"https://api.github.com/users/brunopedroso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunopedroso/subscriptions","organizations_url":"https://api.github.com/users/brunopedroso/orgs","repos_url":"https://api.github.com/users/brunopedroso/repos","events_url":"https://api.github.com/users/brunopedroso/events{/privacy}","received_events_url":"https://api.github.com/users/brunopedroso/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T20:52:20Z","updated_at":"2016-10-24T20:52:20Z","body":"@gr2m I must say I could not reproduce the error with your code.\r\n\r\nI started a new app just like described [here](http://docs.hood.ie/camp/start/getting-started/getting-started-1.html), then I put your code on a new script tag in `index.html` and what I see is a 401 when I try to logout...\r\n\r\n```\r\nclient.js:25722 DELETE http://localhost:8080/hoodie/account/api/session 401 (Unauthorized)\r\n```\r\n\r\nAm I doing something wrong?\r\n\r\n+\r\n```\r\ntest_hoodie_cli_2@1.0.0 /Users/bruno/workspace/test_hoodie_cli_2\r\n`-- hoodie@24.2.5\r\n  +-- @hoodie/account@2.0.1\r\n  | +-- @hoodie/account-client@4.4.0\r\n  | `-- @hoodie/account-server@4.0.5\r\n  +-- @hoodie/admin@1.2.2\r\n  +-- @hoodie/client@5.0.7\r\n  | +-- @hoodie/account-client@2.8.0\r\n  | +-- @hoodie/connection-status@3.0.0\r\n  | +-- @hoodie/log@2.1.0\r\n  | +-- @hoodie/store-client@1.0.0\r\n  | | +-- hoodie-zuul-config@2.0.0\r\n  | | +-- pouchdb-hoodie-api@1.6.4\r\n  | | `-- pouchdb-hoodie-sync@1.4.1\r\n  +-- @hoodie/server@21.1.1\r\n  | +-- @hoodie/store-server@2.1.5\r\n  +-- @hoodie/store@1.0.4\r\n  | `-- @hoodie/store-client@5.0.12\r\n```\r\n"}}
{"actor":{"display_login":"brunopedroso"}}