Closed Bug 1280737 Opened 8 years ago Closed 4 years ago

debugger does not always trigger break points in service worker scripts

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bkelly, Unassigned)

References

(Blocks 2 open bugs)

Details

I don't have exact STR, but this is what I am seeing:

1) Open https://paul.kinlan.me/
2) Open about:debugging
3) Start debugging paul.kinlan.me service worker
4) Set a break point on the line starting "var fetchPromise ="
5) Try to step through the function

This service worker throws an exception on the next line where it calls event.waitUntil() since we don't support async waitUntil() execution yet.

The debugger, though, shows me the "continue" button, but doesn't really seem to be stopped.  The page has moved on to the about:neterror page indicating it has processed the exception.

If I reload the page, sometimes I get my original breakpoint triggered, but sometimes not.

My first issue is:

1) It seems breakpoints should consistently trigger for service worker scripts.  Its unclear why this does not always work for subsequent events.
2) How would someone in the real world use our debugger to figure out event.waitUntil() is throwing causing the promise to respondWith() to reject?  We can improve the rejection message, but it seems like the debugger should have some way of seeing this exceptional case??
Note, Paul will likely fix his site soon.  But you should be able to reproduce on any page using an asynchronous call to event.waitUntil().
I checked "pause on exception" and it didn't seem to help.
Possible related to bug 1280759 since I found a way I can consistently set breakpoints that don't fire over there.
See Also: → 1280759
This is basic functionality that should just work. Marking this as P2 rather than P1 because I also suspect its related to bug 1280759, and that cannot be properly fixed until the service worker refactor is complete (we should still look into possible workarounds, like we are doing in bug 1280759, of course).
Priority: -- → P2
Product: Firefox → DevTools
Blocks: dbg-worker
Priority: P2 → P3

I can't follow the STR from comment #0 (there is no var fetchPromise)

Ben, is your test case still failing for you?
A lot of things has been fixed since the report.

Honza

Flags: needinfo?(ben)

I don't know. I haven't tried recently. I expect you can just close this old bug if you service worker breakpoints are working well for you now.

Flags: needinfo?(ben)

Thanks for the update, closing.

Honza

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.