3
votes

We have been trying to submit an update to a Windows Store Desktop/Tablet App for a few weeks now. The app fails to properly initialize when being tested, but we are unable to reproduce any issues locally.

This is a Javascript WebApp, and we are using Cordova to make it cross-platform.

After adding some remote error logging, we have noticed that on testers' machines there is an IndexedDB initialization error.

The code we that seems to fail is:

var dbOpenRequest = indexedDB.open('CustomDBName', 1);

This seems to fail immediately, and calls our error handler (dbOpenRequest.onerror = ...).

What could cause this?

  • We have tried several devices and admin/guest modes on the OS, etc.

Could this be a test machine issue?

  • Our previously approved and released app also seems to now have this issue. We tried resubmitting our old app and it failed certification (strange!).

Is there any reason that we are not noticing this on any of our devices? We have tested the app on the following devices using the same build we submitted to the store:

  • ASUS T100 Transformer, Win 8.1
  • Dell Venue Pro 11, Win 8.1
  • Digiland 8" Tablet on Win 8.1
  • Misc Surface Tablet
  • Several laptops on Windows 8.1 and 10

The closest support issue I've found related to this seems to be an OS issue: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/7771e681-724c-4229-912c-06b627ce4c16/uwphtml-win10-build-10547-javascript-uwp-indexeddb-cannot-be-opened?forum=wpdevelop

Do you have any ideas or suggestions on what to try next?

2
You can put the logging in your error handler and tell what is the error ?? If IDB is not opening then it means it has never worked in you app or is it that sometimes and in some specific scenarios you get this step ?? Check caniuse.com/#feat=indexeddb to know IDB support for various browsers ..I am assuming your indexedDB is actually a variable holding window.indexedDB because to open a IDB you need window.indexedDB.openhagrawal
@hagrawal the error seems to be "UnknownError". This was working perfectly fine for our first submission, which also used IndexedDB and was successfully submitted to the stores.stringo0
If error is "UnknownError" then it doesn't mean you cannot get information out of it .. FYI - you can get hell of the information from error handler using event.target.error.name, event.target.source.name, event.target.error.message etc., which can be crucial for RCA ..hagrawal
An unknownerror occurs when something Goes wrong with I/O operations. I don't know if You need To add something To the manifest file To ask permission To use the indexeddb storage.Kristof Degrave
@hagrawal, thanks! We are currently logging event.target.error.name but not source or error.message - I'll look into that.stringo0

2 Answers

2
votes

I think you get this error because "window" is missing. Have you tried to do the following? (example code from Microsoft site)

var hDb = null;

try {

   if (window.indexedDB) {

      var req = window.indexedDB.open("CustomDBName", 1);

      req.onsuccess = function(evt) { 
         hDB = evt.target.result;
      }      

      req.onerror = failureHandler();
      req.onblocked = blockedHandler();

      req.onupgradeneeded = function(evt) {
         createDatabaseObjects(evt.target.result);
      }
   }
} catch(ex) {
   handleException(ex);
}

Related information from Microsoft, Cordova IndexDB plugin.

0
votes

Turns out that this time the certification systems had an issue.

The app was finally certified.