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)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g1828+)

RESOLVED FIXED
1.3 C1/1.4 S1(20dec)
blocking-b2g -
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.
(propagating koi? from the bug about duplicated ActiveSync attachments to get this in the backlog)
blocking-b2g: --- → koi?
Target Milestone: --- → 1.2 FC (16sep)
Moved into Pivotal backlog.
Moved into Pivotal backlog.
blocking-b2g: koi? → -
Hi Wayne: Could you tell me that whether this issue will be fixed on V1.1HD or not?
Flags: needinfo?(wchang)
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)
(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)
Tagging this bug to put it in the productivity backlog
Target Milestone: 1.2 FC (16sep) → ---
Assignee: nobody → mcav
Status: NEW → ASSIGNED
Attached file gelam.html
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)
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
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+
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)
Attachment #8346769 - Flags: review?(bugmail) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: