Closed Bug 857964 Opened 12 years ago Closed 12 years ago

[SMS][MMS] Timing issue in ThreadListUI.renderThreads can end up in double entries in thread list

Categories

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

x86
macOS
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g18+)

RESOLVED DUPLICATE of bug 869799
blocking-b2g -
Tracking Status
b2g18 + ---

People

(Reporter: janjongboom, Unassigned)

Details

Attachments

(1 file)

ThreadListUI.renderThreads renders every item in the thread list that it receives on the next tick via a setTimeout. This probably has some historic reasons, but the side-effect is that when the method is called twice in a certain timeframe (length of a tick * list length) double entries end up in the thread list. You can see this behavior f.e. when immediately ponging back a message when sending one. We need to stop the old render action when a new one comes in.
Attached patch PatchSplinter Review
Adds an internal ID that keeps track of the render actions that are running and thus has the ability to stop old render actions. This way there won't be any double entries in the thread list.
Attachment #733233 - Flags: review?(francisco.jordano)
Attachment #733233 - Flags: review?(francisco.jordano) → review?(fbsc)
Could you specify some steps to reproduce? Because the tests are working. Thanks!
Hi Borja, execute the following code in the console when running the app in FF Nightly: MessageManager.getThreads(ThreadListUI.renderThreads);MessageManager.getThreads(ThreadListUI.renderThreads); All threads are in the list now twice.
Where(In reply to janjongboom from comment #3) > Hi Borja, execute the following code in the console when running the app in > FF Nightly: > > MessageManager.getThreads(ThreadListUI.renderThreads);MessageManager. > getThreads(ThreadListUI.renderThreads); Where does this happen in the existing code? > > All threads are in the list now twice.
Rick, this was just to show the effect. This can happen if two events come in right after eachother (gets worse on a big list of SMSes).
Summary: Timing issue in ThreadListUI.renderThreads can end up in double entries in thread list → [SMS][MMS] Timing issue in ThreadListUI.renderThreads can end up in double entries in thread list
Updated the PR to add tests.
Hey, this PR has been open for quite a while now, can either of you review this?
blocking-b2g: --- → tef?
Nominating as tef? as I have managed to get this effect on my phone today (1.0.1) and it looks really really weird.
(In reply to janjongboom from comment #8) > Nominating as tef? as I have managed to get this effect on my phone today > (1.0.1) and it looks really really weird. No data loss, and this isn't a common issue. Please nominate the patch for approval to v1.1 once resolved.
blocking-b2g: tef? → -
tracking-b2g18: --- → +
Comment on attachment 733233 [details] [diff] [review] Patch I would change to a boolean var instead. Please address the comment and ask to review again when ready. Thanks!
Attachment #733233 - Flags: review?(fbsc)
Comment on attachment 733233 [details] [diff] [review] Patch Borja, please see my comment on GH
Attachment #733233 - Flags: review?(fbsc)
I might of duped this @ bug 869799
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Attachment #733233 - Flags: review?(fbsc)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: