{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/7362","repository_url":"https://api.github.com/repos/pouchdb/pouchdb","labels_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/7362/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/7362/comments","events_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/7362/events","html_url":"https://github.com/pouchdb/pouchdb/issues/7362","id":336976432,"node_id":"MDU6SXNzdWUzMzY5NzY0MzI=","number":7362,"title":"In memory PouchDB cannot be destroyed","user":{"login":"kevinkleine","id":866608,"node_id":"MDQ6VXNlcjg2NjYwOA==","avatar_url":"https://avatars1.githubusercontent.com/u/866608?v=4","gravatar_id":"","url":"https://api.github.com/users/kevinkleine","html_url":"https://github.com/kevinkleine","followers_url":"https://api.github.com/users/kevinkleine/followers","following_url":"https://api.github.com/users/kevinkleine/following{/other_user}","gists_url":"https://api.github.com/users/kevinkleine/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinkleine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinkleine/subscriptions","organizations_url":"https://api.github.com/users/kevinkleine/orgs","repos_url":"https://api.github.com/users/kevinkleine/repos","events_url":"https://api.github.com/users/kevinkleine/events{/privacy}","received_events_url":"https://api.github.com/users/kevinkleine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-29T12:14:58Z","updated_at":"2018-06-29T15:55:53Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n     Hello! 👋\r\n     Thank you for opening an issue on PouchDB.\r\n     There is also a 3-Minute read, on how to format your issue:\r\n     https://guides.github.com/features/mastering-markdown/\r\n     This template is optional, but it may help us fix your issue faster.\r\n-->\r\n### Issue\r\nWhen calling destroy() on an in-memory PouchDB instance, a never resolving promise is returned.\r\n\r\n### Info\r\n- Environment: Nodejs v8.9.3\r\n- Platform: Windows\r\n- Adapter: pouchdb-adapter-memory => MemDown\r\n- Server: local db\r\n\r\n### Reproduce\r\n```javascript\r\n'use strict'\r\n\r\nconst   PouchDB         = require( 'pouchdb' )\r\nconst   InMemPouchDB    = PouchDB.defaults({ db: require( 'memdown' ) })\r\n\r\nPouchDB.plugin( require( 'pouchdb-adapter-memory' ) )\r\n\r\nconst   normalDB        = new PouchDB( 'normal' )\r\nconst   inMemDB         = new InMemPouchDB( 'inmem' )\r\n\r\nnormalDB.destroy()\r\n    .then( () => console.log( 'normal db destroyed' ) )\r\n    .catch( console.error )\r\n\r\ninMemDB.destroy()\r\n    .then( () => console.log( 'in-mem db destroyed' ) )\r\n    .catch( console.error )\r\n\r\nsetTimeout(\r\n    () => console.log( 'timeout' )\r\n,   60 * 1000\r\n)\r\n\r\n// outputs:\r\n// normal db destroyed\r\n// timeout\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/comments/401397449","html_url":"https://github.com/pouchdb/pouchdb/issues/7362#issuecomment-401397449","issue_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/7362","id":401397449,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTM5NzQ0OQ==","user":{"login":"daleharvey","id":37787,"node_id":"MDQ6VXNlcjM3Nzg3","avatar_url":"https://avatars1.githubusercontent.com/u/37787?v=4","gravatar_id":"","url":"https://api.github.com/users/daleharvey","html_url":"https://github.com/daleharvey","followers_url":"https://api.github.com/users/daleharvey/followers","following_url":"https://api.github.com/users/daleharvey/following{/other_user}","gists_url":"https://api.github.com/users/daleharvey/gists{/gist_id}","starred_url":"https://api.github.com/users/daleharvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daleharvey/subscriptions","organizations_url":"https://api.github.com/users/daleharvey/orgs","repos_url":"https://api.github.com/users/daleharvey/repos","events_url":"https://api.github.com/users/daleharvey/events{/privacy}","received_events_url":"https://api.github.com/users/daleharvey/received_events","type":"User","site_admin":false},"created_at":"2018-06-29T15:55:53Z","updated_at":"2018-06-29T15:55:53Z","author_association":"MEMBER","body":"Yeh the code for that is @ https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-leveldb-core/src/index.js#L1492, we just leave it hanging if there is no destroy method, not actually sure what the best thing to do is here, just calling back will be confusing since the data will still be there, clearing the data is a bunch of code that seems like it should be the adapters responsibility, or it should throw?"}}
{"actor":{"display_login":"daleharvey"}}