Closed Bug 824190 Opened 12 years ago Closed 12 years ago

[email] once attachments are downloaded, the file size shows NaN

Categories

(Firefox OS Graveyard :: Gaia::E-Mail, defect, P3)

ARM
Gonk (Firefox OS)
defect

Tracking

(blocking-basecamp:+)

VERIFIED FIXED
B2G C4 (2jan on)
blocking-basecamp +

People

(Reporter: nhirata, Assigned: asuth)

Details

Attachments

(3 files)

Attached image screenshot
## Environment :
Unagi phone, build 2012-12-21

## Repro :
1. send yourself an email with a picture or two or 5...
2. open email w/ email account associated
3. download the picture
4. go back to the main list of emails
5. go back to the email with the picture

## Expected :
1. filesize still shows

## Actual :
1. NaN appears as the file size

## Note :
1. probably should suggest some sort of feedback saying that the attachment had been downloaded as well (separate bug?)
adb logcat needed: https://wiki.mozilla.org/Gaia/Email/RequiredBugInfo

This may be ActiveSync only; please try and repro on IMAP.
Keywords: qawanted
It's activesync only.
Attached file logcat
actually I was mistaken.  It happens on both imap and activesync.
Meh.  I posted the logcat, but I should have checked it before posting it to verify that the pref was set.  I'll have to redo it.
The log is fine; there's GeckoDump and GeckoConsole stuff in there.

=== A concerning truncated bit is:
12-26 12:04:00.407: I/GeckoDump(2148): ERR: onerror reporting: Error: Problem handling message type: sliceSplice Error: onsplice notification error T
ypeError: message.subject is null 
12-26 12:04:00.407: I/GeckoDump(2148):  displaySubject@app://email.gaiamobile.org/js/message-cards.js:24
12-26 12:04:00.407: I/GeckoDump(2148): MessageListCard.prototype.updateMessageDom@app://email.gaiamobile.org/js/message-cards.js:605
12-26 12:04:00.407: I/GeckoDump(2148): MessageListCard.prototype.onMessagesSplice/<@app://email.gaiamobile.org/js/message-cards.js:575
12-26 12:04:00.407: I/GeckoDump(2148): MessageListCard.prototype.onMessagesSplice@app://email.gaiamobile.org/js/message-cards.js:569
12-26 12:04:00.407: I/GeckoDump(2148): ma__recv_sliceSplice@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:2031
12-26 12:04:00.407: I/GeckoDump(2148): ma___bridgeReceive@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:1954
12-26 12:04:00.407: I/GeckoDump(2148): createBridgePair/TMB.__sendMessage/<@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:37533
12-26 12:04:00.407: I/GeckoDump(2148): handleMessage@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:686
12-26 12:04:00.407: I/GeckoDump(2148):  
12-26 12:04:00.407: I/GeckoDump(2148):  reportError@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:1794
12-26 12:04:00.407: I/GeckoDump(2148): ma__recv_sliceSplice@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:2035
12-26 12:04:00.407: I/GeckoDump(2148): ma___bridgeReceive@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:1954
12-26 12:04:00.407: I/GeckoDump(2148): createBridgePair/TMB.__sendMessage/<@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:37533
12-26 12:04:00.407: I/GeckoDump(2148): handleMessage@app://email.gaiamobile.org/js/ext/gaia-email-opt.js:686
12-26 12:04:00.407: I/GeckoDump(2148):  @ app://email.gaiamobile.org/js/ext/gaia-email-opt.js : 1794


=== The relevant bit looks to be:
2-26 12:05:47.482: I/GeckoDump(2148): LOG: runOp(do: {"type":"download","longtermId":"0/8","lifecycle":"do","localStatus":"done","serverStatus":"doing","tryCount":0,"humanOp":"download","messageSuid":"0/0/30","mes)
12-26 12:05:48.633: I/GeckoDump(2148): WAR: failed to save attachment to pictures bug.gif type: image/gif
12-26 12:05:48.713: I/GeckoDump(2148): LOG: saved attachment to pictures bug-1356552348648.gif type: image/gif
12-26 12:05:53.277: I/GeckoDump(2148): ERR: onerror reporting: TypeError: attachment._file is null @ app://email.gaiamobile.org/js/message-cards.js : 1269
12-26 12:05:53.287: E/GeckoConsole(2148): [JavaScript Error: "TypeError: attachment._file is null" {file: "app://email.gaiamobile.org/js/message-cards.js" line: 1269}]
12-26 12:06:10.654: I/GeckoDump(2148): ERR: onerror reporting: TypeError: attachment._file is null @ app://email.gaiamobile.org/js/message-cards.js : 1269
12-26 12:06:10.654: E/GeckoConsole(2148): [JavaScript Error: "TypeError: attachment._file is null" {file: "app://email.gaiamobile.org/js/message-cards.js" line: 1269}]
12-26 12:06:12.266: I/GeckoDump(2148): LOG: runOp(local_do: {"type":"download","longtermId":"0/9","lifecycle":"do","localStatus":"doing","serverStatus":null,"tryCount":0,"humanOp":"download","messageSuid":"0/0/30","messa)
12-26 12:06:12.266: I/GeckoDump(2148): LOG: runOp(do: {"type":"download","longtermId":"0/9","lifecycle":"do","localStatus":"done","serverStatus":"doing","tryCount":0,"humanOp":"download","messageSuid":"0/0/30","mes)
12-26 12:06:13.627: I/GeckoDump(2148): WAR: failed to save attachment to pictures Triple-Spiral-Labyrinth-animated.gif type: image/gif
12-26 12:06:13.697: I/GeckoDump(2148): LOG: saved attachment to pictures Triple-Spiral-Labyrinth-animated-1356552373632.gif type: image/gif
This has apparently been going on forever; a Blob's length is stored in "size", not "length".  We update it after the download completes because, at least for IMAP, the file size is just an estimate until we have actually downloaded and decoded the file.

I added unit test coverage that ensures that the attachment size is correct after we download the attachment.  The test failed before the fix, succeeds after it.
Assignee: nobody → bugmail
Status: NEW → ASSIGNED
Attachment #696625 - Flags: review?(squibblyflabbetydoo)
blocking-basecamp: --- → ?
blocking-basecamp: ? → +
Priority: -- → P3
Target Milestone: --- → B2G C4 (2jan on)
landed on gaia-email-libs-and-more/master:
https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/107

landed on gaia/master:
https://github.com/mozilla-b2g/gaia/pull/7275
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Works fine with Unagi, build ID 20130103070201
Status: RESOLVED → VERIFIED
Comment on attachment 696625 [details] [review]
https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/107

Marking r+ since I forgot to do so on the bug (but already did over on github).
Attachment #696625 - Flags: review?(squibblyflabbetydoo) → review+
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: