idb-iegap icon indicating copy to clipboard operation
idb-iegap copied to clipboard

InvalidAccessError on OpenCursor

Open gameboy9 opened this issue 9 years ago • 1 comments

Code used to create the index in question:

    if (oldVersion < 13) {
        var orders = openRequest.transaction.objectStore("orders");
        orders.createIndex("routeSearch", ["dateOfOrder", "routeID", "p_locID", "s_locID", "placementID"], { unique: false }); // routeid, plocid, slocid, iplpk
    }

Code used to access the index:

        var lowerBound = [finalDate, routeLow, '0', '0', '0'];
        var upperBound = [finalDate, routeHigh, '999999999', '999999999', '999999999'];

        var orderTrans = db.transaction("orders", "readonly");
        var orderStore = orderTrans.objectStore("orders");
            var orderIndex = orderStore.index("routeSearch")
            var request = orderIndex.openCursor(IDBKeyRange.bound(lowerBound, upperBound, true, true));

I've discovered that it fails on this line in "return new IEGAPRequest(iegIndex, iegIndex.objectStore.transaction, function (success, error) {":

            var req = iegIndex._idx.openCursor(idbRange, dir);

Could I be doing anything wrong here?

Thanks for your help.

gameboy9 avatar Aug 26 '15 14:08 gameboy9

Thanks for reporting. I hope to have a chance to look at this as soon as I get a chance but we just got a child so I'm short of time the near days.

If there's any body out there that could help with this, feel free to file a pull request and I'll merge it in

dfahlander avatar Aug 27 '15 14:08 dfahlander