indexeddbshim / indexeddbshim/IndexedDBShim
Error on Android 3.2 webview
- Dominant language
- JavaScript
- Stars
- 979
- Forks
- 191
- Avg merge
- 55m
- Merged PRs (30d)
- 2
Description
Hi! I'm developing a offline web app and it work very well with Android 4.4 >, but my employer need it's to work in a old 2011 tablet with Android 3.2, so I came to indexeddbshim. It has about 20 tablets with this awesome version.
I'm using dexie.js.
My code to starts with that:
```js
window.shimIndexedDB.__useShim();
const db = new Dexie('mydatabase', {
indexedDB: window.shimIndexedDB,
IDBKeyRange: window.IDBKeyRange,
});
```
When I force the shim to work the app works well in current Chrome on Windows, but inside the Webview of Android 3.2 I get the following error:
> Uncaught TypeError: Cannot read property '__db' of undefined at https://mywebserver/vendor/indexeddbshim.js:5650
When I click the next button I get the error above.
> 11-08 16:11:33.160 8889-8889/packagename W/Web Console: Unhandled rejection: TypeError: Cannot set property code of undefined which has only a getter
> at defineProperty (native)
> at defineProperty (https://mywebserver/vendor/polyfill.js:5345:12)
> at Function.defineProperty (https://mywebserver/vendor/polyfill.js:2558:14)
> at new DOMException (https://mywebserver/vendor/indexeddbshim.js:1506:16)
> at createNonNativeDOMException (https://mywebserver/vendor/indexeddbshim.js:1602:12)
> at createDOMException (https://mywebserver/vendor/indexeddbshim.js:1710:16)
> at https://mywebserver/vendor/indexeddbshim.js:2799:55
> at https://mywebserver/vendor/polyfill.js:182:13
> at Array.forEach (https://mywebserver/vendor/polyfill.js:3200:12)
> at IDBDatabase.transaction (https://mywebserver/vendor/indexeddbshim.js:2797:16) at https://mywebserver/vendor/dexie.min.js:1
> 11-08 16:11:33.160 8889-8889/packagename E/Web Console: Unhandled promise rejection at https://mywebserver/vendor/polyfill.js:4326
Any tips?
Contributor guide
Research direction
Start by reproducing the failure in the Android 3.2 WebView and trace indexeddbshim.js at lines 5650 and 1506-1710, alongside polyfill.js:5345. Then inspect the transaction path around indexeddbshim.js:2797 and Dexie integration; done means the app can create and use a transaction without either reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- database, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100