-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workbox-window should fire controlling events with isExternal: true #2786
Comments
@jeffposnick Hey Jeffrey! I'm testing the newest version of Workbox and it looks like there is something working not exactly correct with this new functionality. I have this implementation of "page reload for users":
and first time, when I have a new version of service worker - I decline to activate it (the new version). Then I release a new version of the service worker again - I again decline to activate it. If I repeat this process one more time - I stop receiving |
Hello @denieler—how are those new releases detected? Are you calling |
@jeffposnick has this functionality been released? The commit referenced (2426f72) has not been included in any tag as far as I can tell, and npm is still at version 6.1.2 I had figured the fix for |
Oh, that's an excellent point—you're correct in that we need to cut a new release for that and a couple of other bug-fix PRs that have been merged recently. CC: @tropicadri |
@jeffposnick yes, I've tried to reproduce it with
However, I've tried this with the version The first time it calls |
We're looking to get Workbox v6.1.3 out with these related changes early next week. Please give it another try then. |
thank you @jeffposnick! definitely looking forward 🙇 |
Workbox v6.1.5 (which ended up being the next release's version number) includes the changes in #2787. Hopefully things work as expected for you with that version. |
Hey, @jeffposnick 👋 Thank you for the release you've guys made 💪 it almost fixed the issue I've reported, however it looks like there is still something wrong there happening. I don't yet have a confident way to reproduce it, but I will try and report later if will find something. It looks like the |
I'm also seeing this issue on
It’s hard to reproduce but it doesn't seem to matter if the tab is in the background or not and generally just feels inconsistent. I feel like I'm super close with this but this really feels like an issue with |
Hi there, Workbox is moving to a new engineering team within Google. As part of this move, we're declaring a partial bug bankruptcy to allow the new team to start fresh. We realize this isn't optimal, but realistically, this is the only way we see it working. For transparency, here're the criteria we applied:
Thanks, and we hope for your understanding! |
In Workbox v6, we modified the behavior of most of the previous
workbox-window
events so that instead of having "expected" and "external" flavors (waiting
,externalwaiting
, etc.) we would always fire events with the expected name (waiting
, etc.) and set theisExternal
boolean flag accordingly.This change did not happen for the
controlling
event, however, and the only timecontrolling
will be fired is if the service worker that has taken control of the page is the same as the service worker associated withworkbox-window
's original registration.We should update that so that the
controlling
event is also fired when it's a different service worker that's taken control, and setisExternal: true
in that case. (And setisExternal: false
otherwise, which also isn't being set.)workbox/packages/workbox-window/src/Workbox.ts
Lines 503 to 517 in 27080cc
It's arguable whether this is a bug fix or a breaking change—the documentation implies that the
controlling
event would be fired withisExternal: true
in this scenario, so I'm erring on the side of bug fix.CC: @philipwalton in case he has an opinion.
The text was updated successfully, but these errors were encountered: