Closed Bug 1142540 Opened 9 years ago Closed 9 years ago

[Messages][Refactoring] Use Promise as return result for public contacts.js methods

Categories

(Firefox OS Graveyard :: Gaia::SMS, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-master fixed)

RESOLVED FIXED
Tracking Status
b2g-master --- fixed

People

(Reporter: azasypkin, Assigned: julienw)

References

Details

Attachments

(2 files)

After bug 839838 DOMRequest has Promise-based "then()" method. So we can use "navigation.mozContacts.find()" return result as Promise and migrate all public callback-based methods from contacts.js to promises.

It should simplify the code base, especially some places where contacts.js consumers use "Utils.Promise.defer()" to simulate Promise-based interface.
Will try to do this refactoring before we start fixing recipients-related bugs - hope this will make it easier.
Assignee: nobody → azasypkin
Status: NEW → ASSIGNED
Comment on attachment 8585333 [details] [review]
[gaia] julienw:1142540-contact-promises > mozilla-b2g:master

Hey Oleg,

you're likely the best to review this because you also looked at this issue previously :)

I tested on device various situations and I could not make it break.

Tell me what you think !
Attachment #8585333 - Flags: review?(azasypkin)
Assignee: azasypkin → felash
Blocks: 1153883
Blocks: 1153885
Blocks: 1153888
OK Oleg, I think it's ready for a second review. I've put all changes in a separate commit !
Flags: needinfo?(azasypkin)
Comment on attachment 8585333 [details] [review]
[gaia] julienw:1142540-contact-promises > mozilla-b2g:master

Looks good now! Just fix one typo and nit in unit test before landing.

Thanks!
Flags: needinfo?(azasypkin)
Attachment #8585333 - Flags: review?(azasypkin) → review+
Fixed comments and rebased and pushed !
Keywords: checkin-needed
http://docs.taskcluster.net/tools/task-graph-inspector/#PVX9vDT3SuavQpI5CiVQ3g

The pull request failed to pass integration tests. It could not be landed, please try again.
Unrelated issue, landing:

master: 43f67fb074c326286bdb15b31749b0905d427558
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Blocks: 1015194
Depends on: 1154993
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: