Closed
Bug 1066492
Opened 10 years ago
Closed 9 years ago
[dolphin][FTU]interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear
Categories
(Firefox OS Graveyard :: Gaia::Homescreen, defect)
Tracking
(blocking-b2g:-, b2g-v1.4 affected)
People
(Reporter: ben.song, Assigned: yifan, NeedInfo)
References
Details
Attachments
(2 files, 2 obsolete files)
Immediately interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear,the background is exist.
Base on this problem,we find save data of homescreen into indexedDB has been interruption when interruption of power supply before changing language in ftu.So we could get db files of homescreen in /data/local/storage/persistent/1022+f+app+++homescreen.gaiamobile.org/idb has been lost or changed through execution instruction adb shell.
Updated•10 years ago
|
Flags: needinfo?(pehrsons)
Flags: needinfo?(janjongboom)
Comment 2•10 years ago
|
||
Ben, please attach your patch here.
status-b2g-v1.4:
--- → affected
Summary: interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear → [dolphin][FTU]interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear
Comment 3•10 years ago
|
||
qawanted on non-Dolphin devices.
Flags: needinfo?(sergi.mansilla)
Keywords: qawanted
In state.js of homescreen module we find function st_init would get data from indexedDB,and at the start,it would check the db if empty,if true,it would invoke function loadInitialState to save new data into indexedDB;if not,it would get data Immediately. But in the process of interruption of power supply,homescreen began to render and save it's data into indexed,so the save of data would incomplete with a certain probability.
status-b2g-v1.4:
affected → ---
Keywords: qawanted
Summary: [dolphin][FTU]interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear → interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear
Summary: interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear → [dolphin][FTU]interruption of power supply before choosing language in ftu when reset phone,buttons in dockbar and collection is disappear
Attachment #8488539 -
Flags: review?(james.zhang)
[Blocking Requested - why for this release]:
blocking-b2g: --- → 1.4?
QA Whiteboard: qawanted
When this problem occurs we find document 1694510209hnoemeersc and file 1694510209hnoemeersc.sqlite-journal been lost, file 1694510209hnoemeersc.sqlite and 3350367306aesgyanrcoSt.sqlite been changed in /data/local/storage/persistent/1022+f+app+++homescreen.gaiamobile.org/idb.
Updated•10 years ago
|
Attachment #8488539 -
Flags: review?(james.zhang) → review?(janjongboom)
Comment 8•10 years ago
|
||
(In reply to Jan Jongboom [:janjongboom] (Telenor) from comment #3) > qawanted on non-Dolphin devices. You can delete 1694510209hnoemeersc and 1694510209hnoemeersc.sqlite-journal in /data/local/storage/persistent/1022+f+app+++homescreen.gaiamobile.org/idb on flame to reproduce this issue.
Flags: needinfo?(kevin)
Comment 9•10 years ago
|
||
Comment on attachment 8488539 [details] [diff] [review] homescreen.patch Redirecting to Vivien for review.
Attachment #8488539 -
Flags: review?(janjongboom) → review?(21)
Flags: needinfo?(janjongboom)
Updated•10 years ago
|
Flags: needinfo?(pehrsons)
Assignee | ||
Comment 10•10 years ago
|
||
(In reply to ben.song from comment #4) > In state.js of homescreen module we find function st_init would get data > from indexedDB,and at the start,it would check the db if empty,if true,it > would invoke function loadInitialState to save new data into indexedDB;if > not,it would get data Immediately. > But in the process of interruption of power supply,homescreen began to > render and save it's data into indexed,so the save of data would incomplete > with a certain probability. Thank you Ben for the explanation and the fix. There is a flag 'emptyDB' which is used for checking if the IndexedDB of name 'homescreen' exists. The steps for the first time homescreen is launching are as follows: 1. open IndexedDB (emptyDB is false) 2. onupgradeneeded event (if event.oldversion is 0, set emptyDB to true and create an objectStore named 'grid') 3. onsuccess event (if emptyDB is true, loadInitialState) If power is off between step 2 and 3, when power is on the next time 'loadInitialState' might not be running since in the onupgradeneeded event the event.oldversion > 0 and the emptyDB flag will never be true. Same applies to verticalhome.
Assignee | ||
Comment 11•10 years ago
|
||
Hi Ben, Instead of putting the checking flag in mozSettings, could you please try moving it from mozSettings to somewhere like localStorage? Since it's only applicable in homescreen app, we think it might not be mandatory to be saved in mozSettings.
Flags: needinfo?(ben.song)
Reporter | ||
Comment 12•10 years ago
|
||
(In reply to Yi-Fan Liao [:yifan][:yliao] from comment #11) > Hi Ben, > > Instead of putting the checking flag in mozSettings, could you please try > moving it from mozSettings to somewhere like localStorage? Since it's only > applicable in homescreen app, we think it might not be mandatory to be saved > in mozSettings. Hi Yi-Fan, But if homescreen be killed or phone be restart ,whether this localstorage would be clean ?
Flags: needinfo?(ben.song)
Assignee | ||
Comment 13•10 years ago
|
||
It is persistent so the value you saved will be retained for the homescreen app.
Reporter | ||
Comment 14•10 years ago
|
||
(In reply to Yi-Fan Liao [:yifan][:yliao] from comment #13) > It is persistent so the value you saved will be retained for the homescreen > app. Hi Yi-Fan, Do you mean window.localStorage?Thanks.
Assignee | ||
Comment 15•10 years ago
|
||
Yes, you might have seen this on MDN: https://developer.mozilla.org/en/docs/Web/Guide/API/DOM/Storage#localStorage .
Reporter | ||
Comment 16•10 years ago
|
||
Hi Yi-Fan, I have updated this patch with what you said.Please review it.Thanks.
Attachment #8489819 -
Flags: review?(yliao)
Flags: needinfo?(yliao)
Assignee | ||
Comment 17•10 years ago
|
||
Thank you Ben for the fix! Here's the PR to be reviewed for v1.4. * Add a homescreen IndexedDB check flag in localStorage to prevent grid initialization failure due to unexpected power off.
Attachment #8488539 -
Attachment is obsolete: true
Attachment #8489819 -
Attachment is obsolete: true
Attachment #8488539 -
Flags: review?(21)
Attachment #8489819 -
Flags: review?(yliao)
Attachment #8489846 -
Flags: review?(21)
Flags: needinfo?(yliao)
Assignee | ||
Updated•10 years ago
|
status-b2g-v1.4:
--- → affected
Comment 18•10 years ago
|
||
Dear Rachelle, Plz help to push this patch review ,Thanks.
Flags: needinfo?(wchang)
Flags: needinfo?(ryang)
Attachment #8489846 -
Flags: review?(21) → review?(crdlc)
Comment 19•10 years ago
|
||
Comment on attachment 8489846 [details] [review] pull request I think that you have to use the asyncStorage because localStorage is synchronous and slower. What do you think? Thanks
Attachment #8489846 -
Flags: review?(crdlc)
Reporter | ||
Comment 20•10 years ago
|
||
(In reply to Cristian Rodriguez (:crdlc) from comment #19) > Comment on attachment 8489846 [details] [review] > pull request > > I think that you have to use the asyncStorage because localStorage is > synchronous and slower. What do you think? Thanks Hi Cristian, OK,Does it work in this bug,because I have't used this object of asyncStorage.Thank.
Comment 21•10 years ago
|
||
Yes, the library is available https://github.com/begeeben/gaia/blob/1066492_interruption_of_power/apps/homescreen/index.html#L18 The difference is that this is asynchronous https://github.com/begeeben/gaia/blob/1066492_interruption_of_power/shared/js/async_storage.js
Comment 22•10 years ago
|
||
I see review is active now. I don't see this as a blocker for 1.4 given the circumstances and the chances of this happening. We should make sure the solution is given time to be refined instead of rushing it into a time pressured release.
blocking-b2g: 1.4? → -
Flags: needinfo?(wchang)
Reporter | ||
Comment 23•10 years ago
|
||
(In reply to Cristian Rodriguez (:crdlc) from comment #21) > Yes, the library is available > > https://github.com/begeeben/gaia/blob/1066492_interruption_of_power/apps/ > homescreen/index.html#L18 > > The difference is that this is asynchronous > > https://github.com/begeeben/gaia/blob/1066492_interruption_of_power/shared/ > js/async_storage.js Hi Cristian, I would updated new.patch as your said.Thanks
Reporter | ||
Comment 24•10 years ago
|
||
Hi Cristian, This is the updated patch,can you help me to review it? Thanks.
Attachment #8490499 -
Flags: review?(crdlc)
Assignee | ||
Comment 25•10 years ago
|
||
Comment on attachment 8489846 [details] [review] pull request Thanks for pointing it out! And thank you Ben for the help. The change from localStorage to asyncStorage is updated in the PR.
Attachment #8489846 -
Flags: review?(crdlc)
Comment 26•10 years ago
|
||
Comment on attachment 8490499 [details] [diff] [review] update.patch Review of attachment 8490499 [details] [diff] [review]: ----------------------------------------------------------------- https://github.com/begeeben/gaia/blob/1066492_interruption_of_power/shared/js/async_storage.js#L25 getItem sends the value as parameter in a callback
Attachment #8490499 -
Flags: review?(crdlc) → review-
Comment 27•10 years ago
|
||
Comment on attachment 8489846 [details] [review] pull request LGTM, I left a comment on github
Attachment #8489846 -
Flags: review?(crdlc) → review+
Assignee | ||
Comment 28•10 years ago
|
||
Thank you! Sorry for the mistake, fixed in the PR.
Updated•10 years ago
|
Flags: needinfo?(kevin)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → yliao
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•