Closed
Bug 912475
Opened 11 years ago
Closed 11 years ago
Use promise instead of custom event for install request from webapp actor
Categories
(DevTools Graveyard :: WebIDE, defect)
DevTools Graveyard
WebIDE
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 26
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(1 file, 4 obsolete files)
(deleted),
patch
|
ochameau
:
review+
|
Details | Diff | Splinter Review |
When install request has been implemented, there was no promise support.
So that you had to send back a custom event, here `webappsEvent` in order communicate the asynchronous result for this given installation.
We should switch to promise now that the gecko18 branch is frozen.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
This patch is on top of bug 914604 that adds various tests for the actor.
Attachment #799467 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #802313 -
Flags: review?(past)
Comment 3•11 years ago
|
||
Comment on attachment 802313 [details] [diff] [review]
Use promise for async install request instead of sending events. r=past
Review of attachment 802313 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good!
::: toolkit/devtools/server/actors/webapps.js
@@ +192,5 @@
>
> delete aApp.manifest;
> + aDefer.resolve({ appId: aId, path: aDir.path });
> +
> + // Keep sending this event for compatility with old clients
I don't believe we care about supporting old clients. The only scenario we want to support is a recent devtools client targeting an old server (probably embedded in a phone).
@@ +265,5 @@
> installHostedApp: function wa_actorInstallHosted(aDir, aId, aReceipts,
> aManifest, aMetadata) {
> debug("installHostedApp");
> let self = this;
> + let defer = promise.defer();
Nit: the object created by defer() is commonly called deferred, as we routinely use nouns for objects and verbs for functions. In this case you would also use aDeferred for the formal argument.
@@ +512,5 @@
> + appDir.remove(true);
> + } catch(e) {}
> + return { error: "badParameterType",
> + message: "hosted app file and manifest/metadata fields " +
> + "are missing"
Trailing whitespace.
Attachment #802313 -
Flags: review?(past) → review+
Comment 4•11 years ago
|
||
(In reply to Panos Astithas [:past] from comment #3)
> ::: toolkit/devtools/server/actors/webapps.js
> @@ +192,5 @@
> >
> > delete aApp.manifest;
> > + aDefer.resolve({ appId: aId, path: aDir.path });
> > +
> > + // Keep sending this event for compatility with old clients
>
> I don't believe we care about supporting old clients. The only scenario we
> want to support is a recent devtools client targeting an old server
> (probably embedded in a phone).
CCing Dave, in case I'm misrepresenting our current policy.
Comment 5•11 years ago
|
||
I think should assume that developers are using the latest browser on the same channel as the thing they're debugging.
So a nightly b2g build can assume an up-to-date nightly. Once something hits release, the latest release desktop client should work on it.
So since this is only on nightly and will move to aurora on desktop concurrent with/before it gets to aurora on b2g, I don't think we need extra compat here.
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Panos Astithas [:past] from comment #3)
> Comment on attachment 802313 [details] [diff] [review]
> I don't believe we care about supporting old clients. The only scenario we
> want to support is a recent devtools client targeting an old server
> (probably embedded in a phone).
Actually I agree with that with most other features being exposed by the remote protocol, except this one, the install method is already being used by external dependencies. Like b2g remote addon from fabrice that has been forked since by some external contributors.
Assignee | ||
Comment 7•11 years ago
|
||
Like this tool:
https://github.com/arcturus/node-firefoxos-cli
But having look at its source, it wasn't listening for the webappsEvent...
So if you think we shouldn't care I can drop this compatibility layer and try to message projects I see using install request.
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #802313 -
Attachment is obsolete: true
Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 803008 [details] [diff] [review]
Removed compatibility code and renamed all defer to deferred
Review of attachment 803008 [details] [diff] [review]:
-----------------------------------------------------------------
I modified some other pieces of webapps actor that was using defer instead of deferred.
Also I had to modify some new piece of code, tests, that were listening for webappsEvent.
Attachment #803008 -
Flags: review?(past)
Comment 10•11 years ago
|
||
Comment on attachment 803008 [details] [diff] [review]
Removed compatibility code and renamed all defer to deferred
Review of attachment 803008 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/devtools/server/actors/webapps.js
@@ +143,5 @@
> this._actorPool = null;
> this.conn = null;
> },
>
> + _registerApp: function wa_actorRegisterApp(aDefer, aApp, aId, aDir) {
aDefer -> aDeferred
@@ +203,5 @@
> aDir.remove(true);
> });
> },
>
> + _sendError: function wa_actorSendError(aDefer, aMsg, aId) {
Same here.
Attachment #803008 -
Flags: review?(past) → review+
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #803008 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #803060 -
Flags: review+
Assignee | ||
Comment 12•11 years ago
|
||
Attachment #803060 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #805061 -
Flags: review+
Assignee | ||
Comment 13•11 years ago
|
||
Note for checkin, it needs to be landed after bug 914604, which is also ready to land.
Keywords: checkin-needed
Comment 14•11 years ago
|
||
Comment 15•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 26
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•5 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•