Closed
Bug 912825
Opened 12 years ago
Closed 12 years ago
[email] Message reader appears to duplicate body contents when buildBodyDom is called multiple times
Categories
(Firefox OS Graveyard :: Gaia::E-Mail, defect)
Tracking
(blocking-b2g:-, b2g1828+)
Tracking | Status | |
---|---|---|
b2g18 | 28+ | --- |
People
(Reporter: asuth, Assigned: mcav)
References
Details
Attachments
(1 file)
There's a class of errors with duplicated contents/attachments that occur because buildBodyDom populates the page using the available information, in its entirety, every time it is called. This is mainly a problem in that handleBodyChange (hooked up to onchange) can apparently be called multiple times in the case the back-end
This is arguably a combination of front-end and back-end issues.
It appears that in a just-reported bug 912808 (that has other issues, conflated, so I'm not using it), an ActiveSync account ran afoul of the fact that ActiveSyncFolderConn.downloadBodyReps is not quite as clever as ImapFolderConn.downloadBodyReps. The IMAP implementation notices when there is no work to do and returns without triggering a change notification. The ActiveSync notification will always download the body and always generate a change notification.
I would propose the following solution:
- Stop the back-end from doing the double-fetch. This can be handled in ActiveSync, and/or we can push the logic currently in IMAP up into jobmixin.js' do_downloadBodyReps implementation. It's worth noting that our ActiveSync implementation currently only ever produces a single body part, so it lives in a somewhat simpler world than IMAP.
- Declare our contract that we protect the front-end from silly things like this. This mainly means a unit test where we enqueue a second downloadBodyReps job before the first one has executed, then verify that we only get one set of notifications. We should add a comment to that effect.
- Change buildBodyDom to be a little bit smarter about bodies. The 'bodyReps' notification does populate its 'indexes' field so we know what part was downloaded/updated. We could have the routine due an idempotent thing where it creates one div per expected body part and nukes the contents of the div and replaces them if it hears about an update for that div.
- Change buildBodyDom so it doesn't entirely regenerate the attachments container every time. My streaming download patch (to come soon) helps clean up our handling of attachments (I think) so we will actually get some events related to this.
Reporter | ||
Comment 2•12 years ago
|
||
(propagating koi? from the bug about duplicated ActiveSync attachments to get this in the backlog)
blocking-b2g: --- → koi?
Updated•12 years ago
|
Target Milestone: --- → 1.2 FC (16sep)
Comment 3•12 years ago
|
||
Moved into Pivotal backlog.
Hi Wayne:
Could you tell me that whether this issue will be fixed on V1.1HD or not?
Flags: needinfo?(wchang)
Comment 7•12 years ago
|
||
It is not part of v1.1 or v1.2 given by the comments above.
Flags: needinfo?(wchang)
Hi
Bug 914007 is caused by this issue, and the issue will not be fixed on V1.1HD.
Could you accept it?
Flags: needinfo?(brg)
Comment 9•12 years ago
|
||
(In reply to lecky from comment #8)
> Hi
> Bug 914007 is caused by this issue, and the issue will not be fixed on
> V1.1HD.
> Could you accept it?
Yes, please read comment 7.
Flags: needinfo?(brg)
Comment 10•12 years ago
|
||
Tagging this bug to put it in the productivity backlog
tracking-b2g18:
--- → 28+
Target Milestone: 1.2 FC (16sep) → ---
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → mcav
Status: NEW → ASSIGNED
Assignee | ||
Comment 11•12 years ago
|
||
The POP3 work addressed the last two bullets in your recommendation for fixing this (by being smarter in the frontend at rerendering the message bodies).
This patch moves the logic for checking to see if the bodyReps are already downloaded (as used in IMAP) up to the do_downloadBodyReps job layer. The unit test checks to ensure that "onchange" only fires when the body has actually changed, and that we therefore only download the body once.
Attachment #8346769 -
Flags: review?(bugmail)
Assignee | ||
Updated•12 years ago
|
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
Reporter | ||
Comment 12•12 years ago
|
||
Comment on attachment 8346769 [details]
gelam.html
fix looks great. note I have some minor cleanup requests for the test on the pull request. I did inspect the logs and everything seems to be doing the right thing, just the modified expectations I think would make the logs a little easier to read and are more likely to detect wacky regressions.
Attachment #8346769 -
Flags: review?(bugmail) → review+
Assignee | ||
Comment 13•12 years ago
|
||
Comment on attachment 8346769 [details]
gelam.html
Aside: I know you're on PTO this week. I'm probably going to keep flagging you on things for review, but please don't bother looking at any of this now -- go enjoy your vacation. I don't expect or need you to step away from PTO to look at any of these things, it can all wait until after break. It's just easier to track what's left for me if I mark them as I go.
Anyway, I'm re-setting the review flag because I'd like to have you take one more look at the test fixes to make sure it catches everything you intended. Plus, there's a comment in there about POP3 test assertions that I want to see if it makes sense to you.
Attachment #8346769 -
Flags: review+ → review?(bugmail)
Reporter | ||
Updated•12 years ago
|
Attachment #8346769 -
Flags: review?(bugmail) → review+
Assignee | ||
Comment 14•12 years ago
|
||
Merged:
https://github.com/mozilla-b2g/gaia-email-libs-and-more/commit/c348db85fa667ab0d370df070d1220887571de3d
https://github.com/mozilla-b2g/gaia/commit/46a03bc40375a8cb1b2f43a4b429085253535de2
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•