Closed Bug 1097884 Opened 5 years ago Closed 3 years ago

[Messages][Drafts] Thread List panel doesn't display "No messages" screen if invalid draft information is stored in IndexedDB

Categories

(Firefox OS Graveyard :: Gaia::SMS, defect, minor)

ARM
Gonk (Firefox OS)
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: azasypkin, Unassigned)

References

Details

(Whiteboard: [sms-papercuts])

STR:

* Update device gaia with "gaia-reset" to clean all previous app data;
* Open Messages app and create _one_ draft;
* Enter to edit mode and remove the draft created above;
* Close Message app via Task Manager;
* Try to open and close (via Task Manager) Messages app several times;

Expected result: "No messages" string should be always displayed in Thread list;

Actual result: Sometimes you'll see just plain white screen.

The problems boils down to two things:

* Initially we have "{ 'draftIndex': null }" in IndexedDB, but once we created draft and removed it, we have "{ 'draftIndex': [[null,[]]] }" that makes the following statement true "Drafts.size === 1" + Drafts.forEach callback is never executed. That doesn't sound correct;

* There is a race between renderThreads and renderDrafts. So if renderThreads is completed before we get data about drafts from IndexedDB - we'll see "No messages" string, otherwise - we'll see plain white screen. The race is intermittent, that is why you need to run/close app several times to catch the error.

The same is true for v2.0 branch, BUT I can't catch this error there, either mozMobileMessage.getThreads is faster on v2.0, or we have pretty fast IndexedDB on master :)
Whiteboard: [sms-papercuts]
Blocks: 1176976
No longer blocks: 1176976
Mass closing of Gaia::SMS bugs. End of an era :(
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
Mass closing of Gaia::SMS bugs. End of an era :(
You need to log in before you can comment on or make changes to this bug.