{"action":"created","issue":{"url":"https://api.github.com/repos/bramski/angular-indexedDB/issues/36","labels_url":"https://api.github.com/repos/bramski/angular-indexedDB/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/bramski/angular-indexedDB/issues/36/comments","events_url":"https://api.github.com/repos/bramski/angular-indexedDB/issues/36/events","html_url":"https://github.com/bramski/angular-indexedDB/issues/36","id":82164788,"number":36,"title":"IE11 DataError on eachBy with no options","user":{"login":"jrzerr","id":631301,"avatar_url":"https://avatars.githubusercontent.com/u/631301?v=3","gravatar_id":"","url":"https://api.github.com/users/jrzerr","html_url":"https://github.com/jrzerr","followers_url":"https://api.github.com/users/jrzerr/followers","following_url":"https://api.github.com/users/jrzerr/following{/other_user}","gists_url":"https://api.github.com/users/jrzerr/gists{/gist_id}","starred_url":"https://api.github.com/users/jrzerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrzerr/subscriptions","organizations_url":"https://api.github.com/users/jrzerr/orgs","repos_url":"https://api.github.com/users/jrzerr/repos","events_url":"https://api.github.com/users/jrzerr/events{/privacy}","received_events_url":"https://api.github.com/users/jrzerr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-28T23:14:14Z","updated_at":"2015-05-28T23:29:56Z","closed_at":null,"body":"I got a DataError (code 0) on IE11 Edge when using the eachBy on an index but I did not pass any options.  I am calling eachBy without the second parameter, like eachBy(\"indexName\").  The problem is that when the query keyRange is set using:\r\n\r\n```\r\n                    ObjectStore.prototype.eachBy = function(indexName, options) {\r\n                        ...\r\n                        q = new Query();\r\n                        ...\r\n                        q.keyRange = keyRangeForOptions(options);\r\n                        ...\r\n                    };\r\n```\r\n\r\nThe `keyRangeForOptions` function does not return anything in the case when options is not specified.  This does not appear to affect Chrome or Firefox as I've been using the code for a while.  However, I found that IE11 will not work with an undefined keyRange, it must be set to null.  So my fix was to change:\r\n\r\n```\r\n                keyRangeForOptions = function(options) {\r\n                    if (options.beginKey && options.endKey) {\r\n                        return IDBKeyRange.bound(options.beginKey, options.endKey);\r\n                    }\r\n                };\r\n```\r\n\r\nto:\r\n\r\n```\r\n                keyRangeForOptions = function(options) {\r\n                    if (options.beginKey && options.endKey) {\r\n                        return IDBKeyRange.bound(options.beginKey, options.endKey);\r\n                    } else {\r\n                        return null;\r\n                    }\r\n                };\r\n```\r\n\r\nI will work on a Pull Request when I get time.  I just wanted to make sure I documented it here so have a record of what the fix was."},"comment":{"url":"https://api.github.com/repos/bramski/angular-indexedDB/issues/comments/106627150","html_url":"https://github.com/bramski/angular-indexedDB/issues/36#issuecomment-106627150","issue_url":"https://api.github.com/repos/bramski/angular-indexedDB/issues/36","id":106627150,"user":{"login":"bramski","id":421781,"avatar_url":"https://avatars.githubusercontent.com/u/421781?v=3","gravatar_id":"","url":"https://api.github.com/users/bramski","html_url":"https://github.com/bramski","followers_url":"https://api.github.com/users/bramski/followers","following_url":"https://api.github.com/users/bramski/following{/other_user}","gists_url":"https://api.github.com/users/bramski/gists{/gist_id}","starred_url":"https://api.github.com/users/bramski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bramski/subscriptions","organizations_url":"https://api.github.com/users/bramski/orgs","repos_url":"https://api.github.com/users/bramski/repos","events_url":"https://api.github.com/users/bramski/events{/privacy}","received_events_url":"https://api.github.com/users/bramski/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T23:29:56Z","updated_at":"2015-05-28T23:29:56Z","body":"I'll add a milestone to the project for IE11 support.  There's another issue in that realm."}}