From: Surya Kumar Date: Thu, 6 Aug 2020 13:48:00 +0000 (+0530) Subject: Extend StorageData flush on exit for wearable profiles X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6687b429af1086eaed38d1ccb406bdd2208e432c;p=platform%2Fframework%2Fweb%2Fwrtjs.git Extend StorageData flush on exit for wearable profiles If an app exits soon(<~5s) after making localStorage modification, changes aren't committed. So, extend TV's flush mechanisms on exit for wearable profiles to commit storage changes. Fixes P200728-01131. Change-Id: Icedbf7d90be6a4e2b461cdf9f78e7de2e357ef71 Signed-off-by: Surya Kumar --- diff --git a/wrt_app/src/web_application.js b/wrt_app/src/web_application.js index 1c7635c3..0a862e91 100755 --- a/wrt_app/src/web_application.js +++ b/wrt_app/src/web_application.js @@ -396,8 +396,13 @@ class WebApplication { } flushData() { console.log('WebApplication : FlushData'); - if (wrt.tv) { + if (wrt.tv) wrt.tv.flushCookie(); + if (wrt.tv || + // P200728-01131: Unless flushStorageData is called StorageAreaImpl::CommitChanges() + // takes a lot of time leading to uncommited changes on exit on wearable + wrt.getPlatformType() === 'product_wearable' || + wrt.getPlatformType() === 'wearable') { this.windowList.forEach((window) => window.webContents.session.flushStorageData()); } }