Git Product home page Git Product logo

Comments (5)

tszpinda avatar tszpinda commented on May 21, 2024

it maybe related to this safari issue:

https://bugs.webkit.org/show_bug.cgi?id=136937

and its caused by:
Dexie (line 537):
adjustToExistingIndexNames(globalSchema, idbdb.transaction(idbdb.objectStoreNames, READONLY));

from dexie.js.

aaron-schmidt avatar aaron-schmidt commented on May 21, 2024

As outlined in https://bugs.webkit.org/show_bug.cgi?id=136937 this is only an issue on iOS if multiple stores are passed to idbdb.transaction().

The following change will remove the error on iOS but only if the database contains a single store. Databases with multiple stores will still throw an error.

Change (~ line 531):

else if (idbdb.objectStoreNames.length > 0)
    adjustToExistingIndexNames(globalSchema, idbdb.transaction(idbdb.objectStoreNames, READONLY));

To:

else if (idbdb.objectStoreNames.length > 0) {
    var storeNamesHack = idbdb.objectStoreNames.length > 1 ? idbdb.objectStoreNames : idbdb.objectStoreNames.item(0);
    adjustToExistingIndexNames(globalSchema, idbdb.transaction(storeNamesHack, READONLY));
}

Note that using an array that contains a single value will also work:

else if (idbdb.objectStoreNames.length > 0) {
    var storeNamesHack = idbdb.objectStoreNames.length > 1 ? idbdb.objectStoreNames : [idbdb.objectStoreNames.item(0)];
    adjustToExistingIndexNames(globalSchema, idbdb.transaction(storeNamesHack, READONLY));
}

Edit: Changed .item() to .item(0)

from dexie.js.

nolanlawson avatar nolanlawson commented on May 21, 2024

Seems like you've found a new IndexedDB bug in iOS 8. Could you provide a live example and file a bug on WebKit? :)

from dexie.js.

nolanlawson avatar nolanlawson commented on May 21, 2024

Oh nevermind, I see that this IS the same bug. What you're saying is that there's a workaround. (If there's only one store, open using 'databasename' rather than ['databasename'].)

I made a live test case anyway, just for kicks: http://bl.ocks.org/nolanlawson/1d407ac013d92bf998cb

from dexie.js.

dfahlander avatar dfahlander commented on May 21, 2024

Solved. See comments on
this commit

from dexie.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.