Chrome’s data disaster: Browser update wipes out Android app data [Update]
Update: Google has released an official statement:
The M79 update to Chrome and WebView on Android devices was suspended after detecting an issue in WebView where some users’ app data was not visible within those apps. This app data was not lost and will be made visible in apps when we deliver an update this week. We apologize for any inconvenience.
There’s also a blog post, which says the fix is now rolling out now for Android on the stable channel. The updated version is Chrome 79.0.3945.93.
Original Story: Google’s latest Chrome update is causing a headache for users and developers of some Android apps. Chrome 79, which is rolling out across desktop and mobile OSes, has been causing data loss for some other seemingly unrelated Android apps. Thanks to this bug, specifically on Android, updating your browser can now do something like wipe out the data in your Finance app.
The connection between Chrome and Android app data might not be obvious, but Chrome on Android isn’t always just the browser that starts up when you press on the Chrome icon. For some versions of Android, the Chrome app can also provide the built-in HTML render for the entire OS. Apps can call on the system render to display in-app Web content (the API is called “WebView”), and, in this case, an instance of Chrome would seamlessly start up and draw HTML content inside your app. Whether you want to call them “HTML apps” or “Web wrappers,” it’s not uncommon for apps to basically be only a WebView. These apps just turn on and load a webpage, and the Web wrapper provides native Android features like an app drawer icon, full-screen interface, and Play Store distribution. These apps look and work mostly like native apps from a user’s perspective, and it’s hard for even technical users to tell the difference. Cross-platform development is a lot easier when you use HTML, though, since HTML code works everywhere.
The data loss happened because Google changed where Chrome 79 stores profile data without entirely migrating the old data. WebView-based apps can store data through APIs like localstorage, WebSQL, and indexedDB, and apps that use these APIs will suddenly stop finding their data after the user upgrades to Chrome 79. The data isn’t deleted, it’s just misplaced. But to a user, there’s no difference. Their favorite HTML-based app will reset itself to a freshly installed state, and their data won’t be visible. By default, app updates on Android happen automatically and without user interaction, so for most users, their app will just wipe itself out and they won’t know why.
If you want to get technical (and, of course, we do), only Android versions 7, 8, and 9 use the “Chrome” app for the system HTML render. Google has long supported the reasonable stance of updating the Android system HTML-renderer through the Play Store, but it has flip-flopped back and forth on whether using the user-facing Chrome app for system HTML duties is a good idea. Android 5 and 6 used a separate package called “Android System WebView” for Web content, which is very close to Chrome, as it’s based on the Chromium codebase. After three versions of using Chrome, Google went back to the purpose-built Android System WebView app for the latest version, Android 10, saying that the Android System WebView should have “fewer weird special cases and bugs.” In this case it wouldn’t have helped, since both Chrome 79 and Android System WebView 79 have this data-loss bug. The point is that the offending system Web renderer app will change depending on your Android version.