{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/3719","labels_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/3719/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/3719/comments","events_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/3719/events","html_url":"https://github.com/pouchdb/pouchdb/issues/3719","id":67491946,"number":3719,"title":"db.put(doc) silently failing (chrome extension)","user":{"login":"RichardLitt","id":910753,"avatar_url":"https://avatars.githubusercontent.com/u/910753?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardLitt","html_url":"https://github.com/RichardLitt","followers_url":"https://api.github.com/users/RichardLitt/followers","following_url":"https://api.github.com/users/RichardLitt/following{/other_user}","gists_url":"https://api.github.com/users/RichardLitt/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardLitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardLitt/subscriptions","organizations_url":"https://api.github.com/users/RichardLitt/orgs","repos_url":"https://api.github.com/users/RichardLitt/repos","events_url":"https://api.github.com/users/RichardLitt/events{/privacy}","received_events_url":"https://api.github.com/users/RichardLitt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-04-10T02:26:01Z","updated_at":"2015-05-11T19:02:44Z","closed_at":null,"body":"I've got a very simple `db.get(doc)` with a `db.put(doc)` inside of it, but the db.put is returning neither a response nor a value. I'm not sure how to diagnose this problem. I tried switching from callbacks to promises to diagnose it (grasping at straws here), which explains the random comments. Any ideas? \r\n\r\nHere's my code: \r\n\r\n```js\r\nfunction saveSelection (documentId, selection) {\r\n  console.log('Inside saveSelection')\r\n\r\n  db.get(documentId).then(function (value) {\r\n    // if (err && err.name !== 'not_found') {\r\n    //   return console.log('Failed to get ' + documentId + 'from db', err)\r\n    // }\r\n\r\n    /* Instantiate the object if it doesn't exist yet */\r\n    value = value || {}\r\n    value._id = documentId\r\n\r\n    /* Add in the selection to the selections array */\r\n    value.selections = value.selections || []\r\n    value.selections.push(selection)\r\n\r\n    /* Get rid of prototypes so we can put this to the database */\r\n    value = JSON.parse(JSON.stringify(value))\r\n\r\n    // console.log('value', value)\r\n    return db.put(value)\r\n  }).then(function (response) {\r\n    console.log('response', response)\r\n\r\n    // if (err) { console.log('Failed to save selection', err) }\r\n    // console.log('Stored ' + response.id + ' away...', response)\r\n\r\n  }).catch(function (err) {\r\n    console.log(err)\r\n  })\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/comments/101018035","html_url":"https://github.com/pouchdb/pouchdb/issues/3719#issuecomment-101018035","issue_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/3719","id":101018035,"user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T19:02:44Z","updated_at":"2015-05-11T19:02:44Z","body":"Cool, if you figure it out, let us know. :) We definitely want PouchDB to work in Chrome extensions."}}