Closed Bug 1227474 Opened 5 years ago Closed 5 years ago

Promisify all client methods


(DevTools :: Framework, defect)

Not set


(firefox45 fixed)

Firefox 45
Tracking Status
firefox45 --- fixed


(Reporter: ochameau, Assigned: ochameau)




(1 file)

This is very frustrating when using Client APIs today as some returns promises and some others don't.
The very manual `DebuggerClient.request()` is going to return a promise,
whereas all the Client objects defined in devtools/shared/client/main.js that uses `requester` won't!
And all other client using protocol.js fronts are also returning promises.

Because of this, we end up creating inline promises everywhere we have to call a requester method while using Task.jsm.

And it is all related to requester not returning the call the DebuggerClient.request.
At first, I thought changing this to return the promise would break many tests, but it looks like, it doesn't:

I would like to land this, spread the word about this and may be try to remove a bunch of these inlined promises that kill the readability of our codebase in various places.
Blocks: 1225473
Attached patch patch v1Splinter Review
Attachment #8691333 - Flags: review?(jryans)
Comment on attachment 8691333 [details] [diff] [review]
patch v1

Review of attachment 8691333 [details] [diff] [review]:

Hmm, seems too simple. :P

Please at least file a bug to clean up the inline usages.

What about the top-level methods in `DebuggerClient.prototype`?  Many of those don't use `requester`, but would still benefit from promises.
Attachment #8691333 - Flags: review?(jryans) → review+
Yes, I started cleanup up the codebase to benefit from new requester behavior
and hit DebuggerClient.connect/close not being promise ready.
Blocks: 1227978
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 45
Depends on: 1239276
Duplicate of this bug: 1053950
Depends on: 1239287
Depends on: 1243452
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.