cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <>
Subject [jira] [Resolved] (CB-1316) Lose contents of localStorage if backed up while Journal emptying: "Error: database disk image is malformed"
Date Fri, 31 Aug 2012 00:05:08 GMT


Shazron Abdullah resolved CB-1316.

       Resolution: Duplicate
    Fix Version/s: 2.1.0

Thanks for the bug report. This a duplicate of CB-994 which will be in Cordova 2.1.0
> Lose contents of localStorage if backed up while Journal emptying: "Error: database disk
image is malformed"
> ------------------------------------------------------------------------------------------------------------
>                 Key: CB-1316
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 1.8.1
>         Environment: iOS 5.1+
>            Reporter: Nick Richards
>            Priority: Critical
>              Labels: database, ios5.1, localstorage
>             Fix For: 2.1.0
> The v1.6.1 workaround/fix CB-330 for iOS 5.1's localStorage iCloud-related file-deletion
allows me to use localStorage in my app.  However localStorage is sporadically and thereafter
persistently blank when I relaunch my application.  
> Further, when I Download the application via Xcode Organizer to my Mac and open it using
SQLITE3 the database is reported to be corrupt: "Error: database disk image is malformed"
is what sqlite says.  This is seen in (xcappdata)/AppData/Documents/Backups/localstorage.appdata.db
as well as AppData/Library/Caches/file__0.localstorage, after an app exit and restart.  Sometimes
I must time things to rapidly exit after using localStorage in the app (writing to the database)
for this situation to occur.  Also my application is set to exit when the user backgrounds
it, via the info.plist "Application does not run in background" (aka UIApplicationExitsOnSuspend
= YES) setting.
> I expect the localStorage DB to not be corrupted / blank when I resume my application.
> I once saw a SQLITE DB Journal file show up: AppData/Library/Caches/file__0.localstorage.journal
in Xcode's Organizer window while I was using my app.  This got me thinking that Cordova's
CB-330 implementation needs a tweak:  wait to perform the backup until after the Journal file
has been written.  I figure if Cordova backs-up the database while the Journal is still being
emptied then we'll get a corrupted localStorage!
> Thank you,
> Nick

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message