Closed Bug 1391768 Opened 7 years ago Closed 7 years ago

don't ignore result of getSources in source-map-url-service

Categories

(DevTools :: General, enhancement, P3)

enhancement

Tracking

(firefox57 fixed)

RESOLVED FIXED
Firefox 57
Tracking Status
firefox57 --- fixed

People

(Reporter: tromey, Assigned: tromey)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Currently source-map-url-services calls getSources but ignores the result. This will fail to notice a source map if the source actor already existed when the service is created.
Comment on attachment 8902682 [details] Bug 1391768 - register existing source actors in source map service init; https://reviewboard.mozilla.org/r/174356/#review179524 ::: devtools/client/framework/source-map-url-service.js:39 (Diff revision 1) > target.on("will-navigate", this.reset); > > Services.prefs.addObserver(SOURCE_MAP_PREF, this._onPrefChanged); > > // Start fetching the sources now. > - this._loadingPromise = new Promise(resolve => { > + this._loadingPromise = threadClient.getSources(({sources}) => { What are the cases where getSources will reject? I ask because we comment that we want to ignore errors but we don't ever `.catch()`, so it would throw while awaiting in `originalPositionFor`. ::: devtools/client/framework/test/browser_source_map-init.js:34 (Diff revision 1) > +const ORIGINAL_LINE = 11; > + > +add_task(function* () { > + // Opening the debugger causes the source actors to be created. > + const toolbox = yield openNewTabAndToolbox(PAGE_URL, "jsdebugger"); > + // In the bug, when the sourceMapURLService was created, it was Include bug # in this comment
Attachment #8902682 - Flags: review?(bgrinstead) → review+
Comment on attachment 8902682 [details] Bug 1391768 - register existing source actors in source map service init; https://reviewboard.mozilla.org/r/174356/#review179524 > What are the cases where getSources will reject? I ask because we comment that we want to ignore errors but we don't ever `.catch()`, so it would throw while awaiting in `originalPositionFor`. I don't know when `getSources` can have an error; but in any case it doesn't reject the promise, instead it fills out the response in a different way. See https://dxr.mozilla.org/mozilla-central/rev/db7f19e26e571ae1dd309f5d2f387b06ba670c30/devtools/shared/client/main.js#250 I see now I made a small error here, which I'll correct.
Clearly I didn't consider the possibility of a protocol rejection, rather than a server rejection.
Pushed by ttromey@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fcd4aabcec11 register existing source actors in source map service init; r=bgrins
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: