Closed
Bug 1290263
Opened 8 years ago
Closed 8 years ago
Source maps in console don't work after first log
Categories
(DevTools :: Console, defect)
DevTools
Console
Tracking
(firefox51 verified)
VERIFIED
FIXED
Firefox 51
Tracking | Status | |
---|---|---|
firefox51 | --- | verified |
People
(Reporter: jsantell, Assigned: jbhoosreddy)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file, 4 obsolete files)
(deleted),
patch
|
jbhoosreddy
:
review+
|
Details | Diff | Splinter Review |
Via Twitter: https://twitter.com/karfcz/status/758764842354413568
Only the first log for test case logs the source mapped location -- subsequent logs use the generated URL.
STR:
1: Visit http://www.karf.cz/temp/sourcemaps-test/tpl/sourcemaps-test.html
2: Click test 1 or test 2 and see the source mapped location log
3: Click a button again
ER: The subsequent logs should also have a source mapped location
AR: The subsequent logs reference the generated URL.
Reporter | ||
Comment 1•8 years ago
|
||
Karel mentioned this working after a refresh, but I was not able to get any different results after refreshing.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → jaideepb
Assignee | ||
Updated•8 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•8 years ago
|
||
While recreating this bug, this is what I encountered:
There is a bunch of logs which happen in the console that are CSS logs (not related to JavaScript). So the first resolve attempt tries to resolve the CSS location. Therefore attempting a first resolve doesn't trigger a "source-updated" event. So source-mapping for JavaScript actually never happens.
If you refresh with the console open, the "source-updated" event is triggered now. However, in this case, there is a race condition. The "source-updated" event is trigger before the FrameView tries to subscribe the callback to those locations. And hence it is not source-mapped on the "source-updated" event. When the FrameView component subscribes to the location for the first JavaScript log, it only source-maps the first log and doesn't source-map anything else. This is because the first resolve attempt is only to trigger the "source-updated" event from the toolbox and source-mapping for subsequent logs is supposed to occur after "source-updated" event happens.
For this bug, I was able to solve the problem "source-updated" event race condition. And also the service now resolves the first JavaScript console log which it encounters. And therefore it should work nicely without having to remove those optimizations.
Attachment #8776325 -
Flags: review?(jsantell)
Assignee | ||
Comment 3•8 years ago
|
||
Comments for previous still apply.
Attachment #8776325 -
Attachment is obsolete: true
Attachment #8776325 -
Flags: review?(jsantell)
Attachment #8776331 -
Flags: review?(jsantell)
Assignee | ||
Comment 4•8 years ago
|
||
Based on our discussion, in this patch, we attempt to resolve each location when the FrameView component tries to subscribe to the service.
Attachment #8776331 -
Attachment is obsolete: true
Attachment #8776331 -
Flags: review?(jsantell)
Attachment #8777537 -
Flags: review?(jsantell)
Reporter | ||
Comment 5•8 years ago
|
||
Comment on attachment 8777537 [details] [diff] [review]
1290263.patch [3.0]
Review of attachment 8777537 [details] [diff] [review]:
-----------------------------------------------------------------
::: devtools/client/framework/source-map-service.js
@@ +69,5 @@
> * @param callback
> */
> SourceMapService.prototype.unsubscribe = function (location, callback) {
> this.off(serialize(location), callback);
> + if (this._locationStore) {
Add a comment here that sometimes unsubscribes happen during the destruction cascades and that this just protects against it, but maybe should be looked into more in the future
Attachment #8777537 -
Flags: review?(jsantell) → review+
Assignee | ||
Comment 6•8 years ago
|
||
Attachment #8777537 -
Attachment is obsolete: true
Attachment #8777580 -
Flags: review+
Assignee | ||
Comment 7•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/78d61dcf3faf
Source maps in console don't work after first log; r=jsantell
Keywords: checkin-needed
I had to back this out in https://hg.mozilla.org/integration/fx-team/rev/a0a49732aeb4 for test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=10970479&repo=fx-team
Flags: needinfo?(jaideepb)
Assignee | ||
Comment 10•8 years ago
|
||
Assignee | ||
Comment 11•8 years ago
|
||
Assignee | ||
Comment 12•8 years ago
|
||
Assignee | ||
Comment 13•8 years ago
|
||
Assignee | ||
Comment 14•8 years ago
|
||
Assignee | ||
Comment 15•8 years ago
|
||
Assignee | ||
Comment 16•8 years ago
|
||
Assignee | ||
Comment 17•8 years ago
|
||
Assignee | ||
Comment 18•8 years ago
|
||
Fixed the test failing on try.
Attachment #8777580 -
Attachment is obsolete: true
Attachment #8778727 -
Flags: review+
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(jaideepb)
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 19•8 years ago
|
||
bugherder landing |
Keywords: checkin-needed
Comment 20•8 years ago
|
||
Pushed by kwierso@gmail.com:
https://hg.mozilla.org/integration/fx-team/rev/4fb7850312d5
Source maps in console don't work after first log; r=jsantell
Comment 21•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Assignee | ||
Comment 22•8 years ago
|
||
Maybe we want to uplift this and subsequent the patches, working on Source Maps, at least up to Firefox 50?
Flags: needinfo?(jsantell)
Comment 23•8 years ago
|
||
I have reproduced this bug with Firefox nightly 50.0a1(build id:20160728030208)on
windows 7(64 bit)
I have verified this bug as fixed with Firefox nightly 51.0a1(build id:20160822064441)
User Agent:Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
[bugday-20160824]
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(jsantell)
Updated•8 years ago
|
Status: RESOLVED → VERIFIED
Updated•8 years ago
|
Blocks: source-maps
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•