Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 8 bug + workaround #41

Open
pbruining opened this issue Jul 24, 2015 · 0 comments
Open

iOS 8 bug + workaround #41

pbruining opened this issue Jul 24, 2015 · 0 comments

Comments

@pbruining
Copy link

Hello,

The iOS 8 implementation has a bug in it. When the database is opened for the first time iOS 8 returns an absurd high version number, 9223372036854776000. This prevents the upgrade mechanism from creating the object stores and indexes. I fixed it in the generated JavaScript for our project. Could you include my fix in the CoffeeScript?

Regards, Pieter

dbReq.onupgradeneeded = function(event) {
  // Change door GINO, iOS 8 geeft initeel een enorm getal als versie in plaats van 0:
  var oldVersion = event.oldVersion;
  if (oldVersion == 9223372036854776000) {
    oldVersion = 0;
  }
  var tx;
  db = event.target.result;
  tx = event.target.transaction;
  $log.log("$indexedDB: Upgrading database '" + db.name + "' from version " + oldVersion + " to version " + event.newVersion + " ...");
  applyNeededUpgrades(oldVersion, event, db, tx, $log);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant