Closed Bug 991490 Opened 10 years ago Closed 10 years ago

[email/backend] persistent test failure in test_compose_blobs.js due to undefined/null inconsistency in smtp/account.js

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.4 S5 (11apr)

People

(Reporter: asuth, Assigned: asuth)

Details

(Whiteboard: [c= p=0])

Attachments

(1 file)

To paraphrase The Smiths, there is an error that never goes out in test_compose_blobs.js' "large attachments" case.  The root problem is that SmtpAccount's sendMessage callback does callback(null) instead of callback(undefined).

The logging UI says the wacky/confusing thing that:
  namedValue! (name: sent result, value: null) expected but got
  namedValue! (name: sent result, value: null)

This nonsense is because: JSON.stringify([undefined]) === '[null]'
(But our actual test logic in log.js is doing "null === undefined" which correctly evaluates to false.)
Note that there's a vice-versa in comment 0.  The right thing is to explicitly return a null error code when there is no error, not to rely on unspecified arguments to evaluate to undefined.

This makes the tests green on travis again.
Attachment #8401107 - Flags: review?(m)
Comment on attachment 8401107 [details] [review]
do callback(null) instead of callback()

beautiful
Attachment #8401107 - Flags: review?(m) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: