Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 24134DBA5 for ; Thu, 30 Aug 2012 23:49:08 +0000 (UTC) Received: (qmail 43693 invoked by uid 500); 30 Aug 2012 23:49:07 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 43659 invoked by uid 500); 30 Aug 2012 23:49:07 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 43536 invoked by uid 99); 30 Aug 2012 23:49:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Aug 2012 23:49:07 +0000 Date: Fri, 31 Aug 2012 10:49:07 +1100 (NCT) From: "Nick Richards (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <825791924.19241.1346370547834.JavaMail.jiratomcat@arcas> In-Reply-To: <1817909222.19236.1346370428142.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (CB-1316) Lose contents of localStorage if backed up while Journal emptying: "Error: database disk image is malformed" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-1316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nick Richards updated CB-1316: ------------------------------ Description: 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 https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVLocalStorage.m 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 was: 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 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 https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVLocalStorage.m 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 > Lose contents of localStorage if backed up while Journal emptying: "Error: database disk image is malformed" > ------------------------------------------------------------------------------------------------------------ > > Key: CB-1316 > URL: https://issues.apache.org/jira/browse/CB-1316 > 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 > > 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 https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVLocalStorage.m 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: http://www.atlassian.com/software/jira