console.log no longer logs to the error console starting in SDK 1.4

RESOLVED FIXED in 1.5

Status

defect
P1
normal
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: KWierso, Assigned: irakli)

Tracking

unspecified
x86_64
Windows 7
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Posted file test addon
For me on Windows (7 and 8), doing console.log("HELLO"); in an SDK-built addon that's at least SDK 1.4, I no longer get anything logged to Firefox's error console. It shows up in whatever console I'm running cfx from, but it is not sent to the error console.

Which means if I pack up the extension with cfx xpi and install the xpi into Firefox, nothing is getting logged anywhere that I can see.

The attached xpi file was built with a pretty recent SDK (can't remember if I built it from the current master branch or the current stabilization branch), and should log a message as soon as the addon is enabled and then again whenever the widget is clicked. Neither of these things happen for me, though.

I tried to use git bisect to figure out when it stopped working, but using bisect was having a lot of weird things happen so that the extension I was testing against wasn't even installing. I'll try again later to figure it out.

Could someone verify that 
1) this wasn't an intentional change
2) trying out the attached extension does not log any messages when you install it or click the widget?
Assignee: nobody → rFobic
Priority: -- → P1
Target Milestone: --- → 1.5
Oh that's most likely a regression due to the new module loader.
I think that we are missing the following method from the old 'harness.js' file:
https://github.com/mozilla/addon-sdk/blob/1.3/python-lib/cuddlefish/app-extension/components/harness.js#L466-483

We shouldn't only pass `dump` to PlainTextConsole contrustor, but this `forsakenConsoleDump`, here:
https://github.com/mozilla/addon-sdk/blob/master/packages/api-utils/lib/globals!.js#L55
Dave, Dave, and Irakli, we targeted this to 1.5 last week, and we aren't having a triage call this week.

This bug means that developers writing addons from Builder with 1.4(.1) will get NO logging, since there's no other console for them to use from there aside from the error console.

We already did once extra release for 1.4, should we do another to fix this bug? If we don't, we hurt addon devs for the next four weeks.

I'm leaning toward "yes", personally.
Posted file Pull request
As I consider this bug as being a blocker and I'm not sure Irakli is going to be online tomorrow, I went ahead and did a patch.
This pull request is against release branch.

Feel free to pick this patch, or not!
If you want to take it quickly, please try to assign it to someone available for review.
I think Daniel is really the one to make the call on us releasing a 1.4.2 as its obviously mostly going to affect users of Builder at this stage. I'm always reticent to release hotfixes back to back, but will help get it done if what Daniel's determines needs to happen.

Certainly we need to cherry-pick it for the stabilization branch no matter what.
(In reply to Alexandre Poirot (:ochameau) from comment #3)
> Created attachment 592006 [details]
> Pull request
> 
> As I consider this bug as being a blocker and I'm not sure Irakli is going
> to be online tomorrow, I went ahead and did a patch.
> This pull request is against release branch.
> 
> Feel free to pick this patch, or not!
> If you want to take it quickly, please try to assign it to someone available
> for review.

Does this also fix the fallback to console for the notifications module when Growl/libnotify aren't installed?
Yes, it may fix this issue. notification uses console.log as fallback.
So it can't work if you test this on Addon builder.
These fallback message can only work when using cfx run, or running firefox from the command line that allows to see firefox's stdout.
Comment on attachment 592006 [details]
Pull request

As dbuc said to me on IRC, he isn't sure that he is the right person to make that call.
This morning, one guy came to #jetpack channel and was thinking that its addon was breaking on 1.4.1 ... it was just this console issue. He would never have thought that console messages won't work.

I really think this bug is critical and prevent developers from using the builder, and if they try to use it, they will loose tons of hairs to figured out was is happening. It doesn't seem reasonable to wait for 1.5 release to fix this. But we may take some additional time to test a new 1.4.2 release in order to ensure that's the good one. And so avoid having to release a 1.4.3!
So please, figured out who has to make the call.

To make this bug move forward, I'm asking Irakli's review.
Attachment #592006 - Flags: review?(rFobic)
Attachment #592006 - Flags: review?(rFobic) → review+
(In reply to Alexandre Poirot (:ochameau) from comment #7)
> Comment on attachment 592006 [details]
> Pull request
> 
> As dbuc said to me on IRC, he isn't sure that he is the right person to make
> that call.


I disagree - this is Daniel's call. Its his product that he manages being affected by this. SDK users still get their messages in the terminal so it really doesn't affect them.

Daniel, I think you should take Alex's opinion and any other evidence into account and decide if you'd like us to push another release.
So I want to make sure everyone is aware of the issue, its source, and what it means:

I have the SDK running via the command line right now, and add-ons it generates do not, under any circumstances log to the Fx command line. That part of the SDK is currently broken. If you are just doing cfx run, you see the logging in the system command line, but that doesn't mean it is just a Builder thing. Anyone testing an add-on via any creation mechanism, Builder or command line, that needs to see it restart or close Firefox, will not get any console output either.

In the end, Builder is the most *clearly affected use-case* but certainly not the only one. IMO the call is for whether the SDK team feels a fix of the SDK code base is warranted to resolve issues it is creating for a variety of use-cases and downstream consumers, which includes the Builder.

Is this description of the issue inaccurate?
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/ca053c1e967ec8053bfc962d3746c80b6c0eb553
@ochameau - Bug 718230 - console.log() no longer logs to the error console starting in SDK 1.4; r=gozala
Pushed this to the master branch for now for wider testing. If we do decide to do another 1.4 release, we can do it later.
Just spoke to Daniel offline and determined that this is a P1 blocker for builder - so we should spin up a 1.4.2 with this fix.
Commit pushed to release at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/4bc2bdb43f6593527a46814e9516af94a6b764cb
@ochameau - Bug 718230 - console.log() no longer logs to the error console starting in SDK 1.4; r=gozala
(cherry picked from commit ca053c1e967ec8053bfc962d3746c80b6c0eb553)
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/4bc2bdb43f6593527a46814e9516af94a6b764cb
@ochameau - Bug 718230 - console.log() no longer logs to the error console starting in SDK 1.4; r=gozala
Huzzah.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.