{"action":"created","issue":{"url":"https://api.github.com/repos/techfort/LokiJS/issues/196","labels_url":"https://api.github.com/repos/techfort/LokiJS/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/techfort/LokiJS/issues/196/comments","events_url":"https://api.github.com/repos/techfort/LokiJS/issues/196/events","html_url":"https://github.com/techfort/LokiJS/issues/196","id":96111732,"number":196,"title":"Uncaught Error: NOT_FOUND_ERR: DOM IDBDatabase Exception 3","user":{"login":"cosmith","id":1194749,"avatar_url":"https://avatars.githubusercontent.com/u/1194749?v=3","gravatar_id":"","url":"https://api.github.com/users/cosmith","html_url":"https://github.com/cosmith","followers_url":"https://api.github.com/users/cosmith/followers","following_url":"https://api.github.com/users/cosmith/following{/other_user}","gists_url":"https://api.github.com/users/cosmith/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmith/subscriptions","organizations_url":"https://api.github.com/users/cosmith/orgs","repos_url":"https://api.github.com/users/cosmith/repos","events_url":"https://api.github.com/users/cosmith/events{/privacy}","received_events_url":"https://api.github.com/users/cosmith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-20T17:08:27Z","updated_at":"2015-07-20T22:14:08Z","closed_at":null,"body":"Hi,\r\n\r\nI'm seeing this error in my Flurry logs when using Loki with the IndexedDB adapter:\r\n\r\n```\r\nUncaught Error: NOT_FOUND_ERR: DOM IDBDatabase Exception 3\r\n```\r\n\r\nI found this SO question http://stackoverflow.com/questions/9872806/dom-idbdatabase-exception-3-when-using-indexeddb that seems to give a solution, but I'm not sure where it could happen in the adapter code. I thought adding a try/catch block around the adapter instantiation would fix it but no luck.\r\n\r\nThe error is happening only on certain devices (I'm using Cordova), most notably the Samsung Galaxy S III.\r\n\r\nThis is my code at the moment:\r\n\r\n```js\r\n    static _getAdapter() {\r\n        var adapter = null, dbname = \"loki\";\r\n\r\n        try {\r\n            adapter = new LokiIndexedAdapter(dbname);\r\n            if (!adapter.checkAvailability()) {\r\n                adapter = new LokiCordovaFSAdapter({\"prefix\": dbname});\r\n            }\r\n        }\r\n        catch (e) {\r\n            console.warn(\"[Database]\", e);\r\n            adapter = new LokiCordovaFSAdapter({\"prefix\": dbname});\r\n        }\r\n\r\n        return adapter;\r\n    }\r\n```\r\n\r\nI'm not sure the error is in that code though... all I get is \"error in loki-indexed-adapter.min.js at line 1\". Maybe I should use the unminified version to get more info.\r\n\r\nI'm going to keep investigating, but if anyone has an idea or has seen this before..."},"comment":{"url":"https://api.github.com/repos/techfort/LokiJS/issues/comments/123067045","html_url":"https://github.com/techfort/LokiJS/issues/196#issuecomment-123067045","issue_url":"https://api.github.com/repos/techfort/LokiJS/issues/196","id":123067045,"user":{"login":"obeliskos","id":7353046,"avatar_url":"https://avatars.githubusercontent.com/u/7353046?v=3","gravatar_id":"","url":"https://api.github.com/users/obeliskos","html_url":"https://github.com/obeliskos","followers_url":"https://api.github.com/users/obeliskos/followers","following_url":"https://api.github.com/users/obeliskos/following{/other_user}","gists_url":"https://api.github.com/users/obeliskos/gists{/gist_id}","starred_url":"https://api.github.com/users/obeliskos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obeliskos/subscriptions","organizations_url":"https://api.github.com/users/obeliskos/orgs","repos_url":"https://api.github.com/users/obeliskos/repos","events_url":"https://api.github.com/users/obeliskos/events{/privacy}","received_events_url":"https://api.github.com/users/obeliskos/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T22:14:08Z","updated_at":"2015-07-20T22:14:08Z","body":"If that is the case and you just have to work with it, you might look into a polyfill (like this one?) since those earlier android browsers probably -do- support websql : \r\n\r\nhttps://github.com/axemclion/IndexedDBShim"}}