Closed
Bug 820310
Opened 12 years ago
Closed 12 years ago
[B2G SMS] Multiple markMessageRead() calls causes significant performance issues
Categories
(Firefox OS Graveyard :: Gaia::SMS, defect, P2)
Tracking
(blocking-basecamp:+)
People
(Reporter: ferjm, Assigned: ferjm)
References
Details
(Whiteboard: [drop if not fixed by 1/2 (2wks)])
Attachments
(3 files, 1 obsolete file)
As explained in https://bugzilla.mozilla.org/show_bug.cgi?id=813978#c48 multiple calls to |markMessageRead()| causes a pretty bad performance issue when entering in an SMS thread message view. This bug is supposed to track the required work, in the platform or in the UI side, to improve this performance.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → ferjmoreno
I suggested we try the following approach in the UI: function markMessagesRead(ids) { var id = ids.pop(); navigator.mozSMS.markMessageRead(id, true).onsuccess = function() { if (ids.length) { markMessagesRead(ids); } }; } If that shows to be too slow, we can look at changing the API.
Assignee | ||
Comment 3•12 years ago
|
||
Assignee | ||
Comment 4•12 years ago
|
||
As you can see in the attached logcat, the gaia modifications to chain the calls to |markMessageRead()| are not helping that much :(. For some reason, the first call to |markMessageRead()| when entering in a message view sometimes takes like forever... I'll try to debug the platform side to see where are we spending that much time.
Updated•12 years ago
|
blocking-basecamp: ? → +
Priority: -- → P3
Assignee | ||
Updated•12 years ago
|
Assignee | ||
Comment 5•12 years ago
|
||
I've been doing some more tests and it seems that the problem wasn't in the platform but on the Gaia side. We were calling |getMessages| without a filter (which means that we were following the painful slow path for getting all the messages) after marking the messages as read. After removing this call to |getMessages| the logs show that the times retrieving and marking the messages as read are pretty decent. I am attaching a small sample of this logs. I've been talking with Borja and he recommended me to wait until Bug 815260 lands before sending any PR with the required modifications to chain the calls to |markMessageRead|.
Updated•12 years ago
|
Target Milestone: --- → B2G C3 (12dec-1jan)
Updated•12 years ago
|
blocking-basecamp: + → ---
Whiteboard: [drop if not fixed by 1/2 (2wks)]
Updated•12 years ago
|
blocking-basecamp: --- → +
Priority: -- → P2
Assignee | ||
Updated•12 years ago
|
Attachment #690903 -
Attachment is obsolete: true
Assignee | ||
Comment 8•12 years ago
|
||
Comment on attachment 694903 [details] Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/7149 I'd like to add the functionality to mark the thread as read (visually) as soon as it is clicked as that would be a better UX. How can I do that Borja?
Attachment #694903 -
Flags: feedback?(fbsc)
Comment 9•12 years ago
|
||
Only one issue. Check in Github the following: https://github.com/mozilla-b2g/gaia/pull/7149#issuecomment-11651095 The rest of the code looks great! Thanks for your support ;). Let me know when you fix it and I will review it again.
Assignee | ||
Comment 10•12 years ago
|
||
Thanks Borja, I've just addressed your feedback and also added the ability to visually mark the thread as read just right after clicking on it to change to the message view (as I requested in comment 8). This way, even if all the messages are not still marked as read in the db, if the user gets back to the thread view, she will see the thread marked as read, which means a better UX.
Assignee | ||
Updated•12 years ago
|
Attachment #694903 -
Flags: feedback?(fbsc) → review?(fbsc)
Updated•12 years ago
|
Attachment #694903 -
Flags: review?(fbsc) → review+
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•