Data from IonicStorageModule not found in Chrome Dev Tools (Android)

I haven’t updated my app in years. Call it a testament to the great work of the ionic folks. :wink:

That said, I’m using the IonicStorageModule to store data in both new and old apps. When I upgrade to the new version on Android, the data is gone. When I go back to the old version of the app, the data is not visible in the Chrome Dev Tools—BUT THE APP STILL ACTS LIKE THE DATA IS THERE!!!

  1. Yes, I refreshed IndexedDB.
  2. Yes, I restarted Chrome.
  3. Yes, I restarted my computer.
  4. Yes, I looked under local storage, session storage, Web SQL, IndexedDb, Cookies, Private State Tokens, Interest Groups, Shared Storage, and Cache Storage. (No the data wasn’t shown there)

I did see that under Issues in the Chrome Dev Tools that there’s a Deprecated Feature Used.

StorageType.persistent deprecated. Please use standardized navigator.storage instead.

So this is the question. Is there some hidden space where the data might be?

Old Version:

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.9
   @ionic/app-scripts : 3.2.4

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : android 8.1.0
   Cordova Plugins       : cordova-plugin-ionic-webview 4.1.3, cordova-plugin-ionic 5.4.6, (and 15 other plugins)

System:

   Android SDK Tools : 26.1.1 (/usr/local/share/android-sdk)
   ios-sim           : 8.0.2
   NodeJS            : v10.22.0 (/usr/local/bin/node)
   npm               : 6.14.6
   OS                : macOS Unknown
   Xcode             : Xcode 14.3.1 Build version 14E300c

New Version

Ionic:

   Ionic CLI                     : 7.1.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.7.2 (/Users/<path>/node_modules/@ionic/angular)
   @angular-devkit/build-angular : 15.2.4 (/Users/<path>/node_modules/@angular-devkit/build-angular)
   @angular-devkit/schematics    : 15.1.6 (/Users/<path>/node_modules/@angular-devkit/schematics)
   @angular/cli                  : 15.2.5 (/Users/<path>/node_modules/@angular/cli)
   @ionic/angular-toolkit        : not installed

Utility:

   cordova-res (update available: 0.15.4) : 0.15.1
   native-run (update available: 1.7.2)   : 1.0.0

System:

   NodeJS : v18.17.1 (/usr/local/bin/node)
   npm    : 9.6.7
   OS     : macOS Unknown

I had a similar issue, I solved it today. The root cause could be different but it may get the gears turning for you.

Here’s some things to check:

  • When you updated your app, did the scheme change? (http vs https)
  • Did the base URL changes? (file:///android_asset/www/index.html vs https://localhost)
  • Could you be using SQLite for storage? That does not show up in chrome dev tools, since it’s a local database.
  • Have you tried console logging the driver name on the old and new version to see if anything changed there?
  • Any notable package or plugin updates? Particularly with storage or sqlite related ones?

It was definitely a problem with SQLite. Thanks for following up!

1 Like