Closed Bug 1220261 Opened 9 years ago Closed 9 years ago

very difficult to update service worker script during local development

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bkelly, Unassigned)

References

Details

I believe the new update algorithm has landed, but its still very difficult to do local development of a service worker script.  I find I am having to go so far as to manually wipe quota manager storage, unregister the SW, and restart the browser to get the SW script to update.
I guess the issue is that the new service worker can be stuck in the waiting state until all current windows are closed and the existing service worker stops.  I guess this is per spec, but annoying for developers.

Does this sound right Catalin?
Flags: needinfo?(catalin.badea392)
This time I couldn't get it to go to waiting at all.  I did this:

1) unregistered
2) wiped storage
3) refreshed page again

And I got the exact same cache name in about:serviceworkers I did before step 1.  That seems bogus to me.
Oh... In comment 2 I had a syntax error in my script.  But with an existing service worker the .register() resolved success and I got no console reports indicating the error.  Sigh...
Catalin writes in IRC:

 <catalinb> bkelly: so it looks like when you reload, our controlled counter doesn't reach 0, which would explain why the waiting worker doesn't replace the active worker.
(In reply to Ben Kelly [:bkelly] from comment #1)
> I guess the issue is that the new service worker can be stuck in the waiting
> state until all current windows are closed and the existing service worker
> stops.  I guess this is per spec, but annoying for developers.
> 
> Does this sound right Catalin?

Yes, I also checked this in chrome, same behaviour.
Flags: needinfo?(catalin.badea392)
Is this caused because we put the controlled document in the bf-cache?
This has been working better for me.  I still have some unexpected behavior, but its less frequent and seems isolated to e10s.  I opened a separate (non blocking) bug for that.  See bug 1225350.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Bill, are seeing recent problems here?  I saw your recent cc additions.  A lot has changed for the better since this bug.
Flags: needinfo?(bwalker)
Hi Ben, thanks for checking in -- in our workshop today we're seeing some hiccups here, but it's nothing you don't know about. I probably didn't need to CC everybody on this old bug :)
Flags: needinfo?(bwalker)
You need to log in before you can comment on or make changes to this bug.