{"action":"opened","issue":{"url":"https://api.github.com/repos/superfeedr/indexeddb-backbonejs-adapter/issues/80","labels_url":"https://api.github.com/repos/superfeedr/indexeddb-backbonejs-adapter/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/superfeedr/indexeddb-backbonejs-adapter/issues/80/comments","events_url":"https://api.github.com/repos/superfeedr/indexeddb-backbonejs-adapter/issues/80/events","html_url":"https://github.com/superfeedr/indexeddb-backbonejs-adapter/issues/80","id":59879149,"number":80,"title":"Error thrown while aborting fetch","user":{"login":"ncortines","id":7069922,"avatar_url":"https://avatars.githubusercontent.com/u/7069922?v=3","gravatar_id":"","url":"https://api.github.com/users/ncortines","html_url":"https://github.com/ncortines","followers_url":"https://api.github.com/users/ncortines/followers","following_url":"https://api.github.com/users/ncortines/following{/other_user}","gists_url":"https://api.github.com/users/ncortines/gists{/gist_id}","starred_url":"https://api.github.com/users/ncortines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncortines/subscriptions","organizations_url":"https://api.github.com/users/ncortines/orgs","repos_url":"https://api.github.com/users/ncortines/repos","events_url":"https://api.github.com/users/ncortines/events{/privacy}","received_events_url":"https://api.github.com/users/ncortines/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-04T23:20:50Z","updated_at":"2015-03-04T23:20:50Z","closed_at":null,"body":"Hi,\r\n\r\nI found that triggering `abort` on a fetch operation with a range condition works fine:\r\n```javascript\r\nmovies.fetch({\r\n\tconditions: {\r\n\t\ttitle: ['A', 'Z']\r\n\t}\r\n}).abort()\r\n```\r\nHowever when specifying a single value condition error is thrown upon `abort` invocation:\r\n```javascript\r\nmovies.fetch({\r\n\tconditions: {\r\n\t\ttitle: 'Goonies'\r\n\t}\r\n}).abort()\r\n```\r\nthrows `Uncaught DataError: Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.`\r\n\r\nThe problem since to lay in this piece of code, which seems to asume the first case scenario:\r\n```javascript\r\nif (bounds && options.conditions[index.keyPath]) {\r\n\tcursor.continue(options.conditions[index.keyPath][1] + 1); /* We need to 'terminate' the cursor cleany, by moving to the end */\r\n```\r\nThe following since to fix the problem:\r\n```javascript\r\nif (bounds && options.conditions[index.keyPath] && _.isArray(options.conditions[index.keyPath])) {\r\n\tcursor.continue(options.conditions[index.keyPath][1] + 1); /* We need to 'terminate' the cursor cleany, by moving to the end */\r\n```\r\nPlease let me know what do you think.\r\n\r\nThanks!"}}