Service worker console logs are blank
Categories
(DevTools :: Console, defect)
Tracking
(firefox-esr115 unaffected, firefox-esr128 unaffected, firefox131 wontfix, firefox132 fixed, firefox133 fixed)
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | unaffected |
firefox131 | --- | wontfix |
firefox132 | --- | fixed |
firefox133 | --- | fixed |
People
(Reporter: jeffduy, Assigned: jdescottes)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(3 files)
14.61 KB,
image/png
|
Details | |
76.29 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0
Steps to reproduce:
On Firefox 131, I inspected a running service worker that has console logs.
Actual results:
Console logs are happening but they are all blank. I see a timestamp and they're grouped since they're all blank.
Expected results:
Console logs should log whatever visibly. Reverting to Firefox 130 fixes my issue.
Comment 1•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Assignee | ||
Comment 2•3 months ago
|
||
Need to try and reproduce, maybe with STRs from Bug 1429805
We don't recall any change around service worker debugging between 130 and 131, but maybe something was updated.
There are also some reports on https://discourse.mozilla.org/t/how-to-enable-console-log-from-service-worker/130394/8 for issues with servce worker logs.
Assignee | ||
Comment 3•3 months ago
|
||
I'm actually unable to see any log in the regular devtools console for service workers, in Nightly or in ESR, even after enabling devtools.debugger.features.windowless-service-workers
But they show up in the Browser Console.
jeffduy: do you have a public test page you could share?
Comment 4•3 months ago
|
||
Note that also toggling dom.worker.console.dispatch_events_to_main_thread
to false (in addition to devtools.debugger.features.windowless-service-workers
) helps see the messages.
I also couldn't reproduce "blank" messages. It either show up with the two prefs toggled, or not at all.
The log looks like this
self.addEventListener('activate', function (event) {
event.waitUntil(
(async () => {
console.log('active event: ', event);
return self.clients.claim();
})()
);
});
Assignee | ||
Comment 6•3 months ago
|
||
(In reply to jeffduy from comment #5)
Created attachment 9431247 [details]
Screenshot 2024-10-16 at 10.06.16 AMThe log looks like this
self.addEventListener('activate', function (event) { event.waitUntil( (async () => { console.log('active event: ', event); return self.clients.claim(); })() ); });
Maybe we have trouble serializing the event object? What if you try to add another console.log only with a string?
With dom.worker.console.dispatch_events_to_main_thread
to true and devtools.debugger.features.windowless-service-workers
to false (which I think are the default values? I've never messed with them before at least) I am getting the blank messages.
I don't have a public test page atm, but I can try to get one up for you. In the mean time, I've attached a screenshot of the service worker console with the blank output just trying to log the activate event.
No dice on just logging a string either.
Interestingly enough, even console.logging directly into the service worker console produces blank messages
Assignee | ||
Comment 9•3 months ago
|
||
(In reply to jeffduy from comment #7)
With
dom.worker.console.dispatch_events_to_main_thread
to true anddevtools.debugger.features.windowless-service-workers
to false (which I think are the default values? I've never messed with them before at least) I am getting the blank messages.I don't have a public test page atm, but I can try to get one up for you. In the mean time, I've attached a screenshot of the service worker console with the blank output just trying to log the activate event.
No dice on just logging a string either.
Are you debugging them via about:debugging? I assumed it was done via a regular toolbox debugging a webpage, but your comment probably means are actually using about:debugging?
Reporter | ||
Comment 10•3 months ago
|
||
Ah yes, correct I am debugging them via about:debugging; Sorry I should have made that more explicit.
Assignee | ||
Comment 11•3 months ago
|
||
Ah thanks! I can reproduce on Firefox 131. On Nightly (Firefox 133) it seems "fixed" for live messages, but I still see blank messages for messages retrieved from the cache.
Assignee | ||
Updated•3 months ago
|
Assignee | ||
Comment 12•3 months ago
•
|
||
Only seems to affect 131, so either it's a regression specific to this version, or it's something specific to the release channel (eg a preference?)
Edit: Even if live messages work in 132 and 133, I verified on ESR 128 that even cached messages were working back then. So there's definitely still some regression, albeit less severe.
Assignee | ||
Updated•3 months ago
|
Assignee | ||
Comment 13•3 months ago
|
||
Hi Andrew, do you know if anything changed between Firefox 130 and 131 for service worker log messages? DevTools seems to struggle to retrieve the text for those. In 132 and 133 it works for messages captured live by the toolbox, but cached messages are blank?
Assignee | ||
Comment 14•3 months ago
|
||
This is probably on DevTools side, I seem to get the messages properly in the client. Sorry for the noise.
Assignee | ||
Comment 15•3 months ago
|
||
This was regressed when we removed the backward compat code for 131 at Bug 1912237. The compat comment states that console messages are no longer encapsulated in a "message" property but that's wrong, at least for cached worker messages.
Assignee | ||
Comment 16•3 months ago
|
||
Initial change was done in Bug 1901644, but at that time, the backward compat code helped to make things still work for a while.
Then in 131 it regressed when said code was removed. And the live messages bug was fixed in Bug 1921384. Only cached messages are still broken.
Assignee | ||
Comment 17•3 months ago
|
||
(clearing the ni? the regression was clearly identified, thanks for the answers!)
Assignee | ||
Comment 18•3 months ago
|
||
Updated•3 months ago
|
Updated•3 months ago
|
Comment 19•3 months ago
|
||
Comment 20•3 months ago
|
||
bugherder |
Comment 21•3 months ago
|
||
The patch landed in nightly and beta is affected.
:jdescottes, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox132
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 22•3 months ago
|
||
Comment on attachment 9431309 [details]
Bug 1923648 - [devtools] Fix logging cached service worker messages in about:debugging
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Cached messages from service workers are blank in DevTools
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): DevTools-only change, which only impacts logging of console messages from service workers. Change itself is trivial and has automated tests.
- String changes made/needed:
- Is Android affected?: No
Updated•3 months ago
|
Comment 23•3 months ago
|
||
Comment on attachment 9431309 [details]
Bug 1923648 - [devtools] Fix logging cached service worker messages in about:debugging
Approved for 132.0rc1.
Updated•3 months ago
|
Comment 24•3 months ago
|
||
uplift |
Description
•