Dexie.js
Dexie.js copied to clipboard
iOS 16.7.3 / 16.7.4 "Cannot inject key into script value"
There is a bug in Webkit which affects iOS 16.7.3 and iOS 16.7.4 that causes reads from IndexedDB with "key generators" to fail. Key generators are used by Dexie internally to implement auto increment keys. So any Dexie table that uses auto increment keys will fail to be read when upgrading to these versions.
The exception that is thrown is UnkownError: Cannot inject key into script value
.
This leaves the database in an unusable state, the only mitigation is to remove the affected rows (or removing the entire database).
This problem happened in iOS 17.2 beta too, but it was fixed in iOS 17.2 final, so this problem is not widespread in iOS 17.x. However, the bug appeared in 16.7.3/16.7.4 but was never fixed in iOS 16.7.X which is causing a greater deal of problems.
Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=264099 This issue was also encounterned in Firebase JS SDK: https://github.com/firebase/firebase-js-sdk/issues/7742