-
Notifications
You must be signed in to change notification settings - Fork 443
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
fix: service worker communicates with the latest client only #573
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@vladetsky - Awesome to see this get fixed, thank you! I've confirmed that all of the tests added in #493 which adds tests for #492 pass with your fix applied. Once this PR is merged, I'll adjust #493 so it can be merged which will add some additional test coverage for your fix. |
Thanks for testing this fix @techfg ! |
Thanks @vladetsky @techfg for your help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vladetsky for this great improvement 👏
@vladetsky unfortunately I think this might still be happening. Please check out I tried to keep the repro as simple as possible. The proxied function simply gets and sets from localStorage. As soon as another tab is open, the errors start popping up again. |
@tibineagu You have an outdated inline script here. Please update it to |
@vladetsky oh my god you're right - i must have copied that from the wrong place. Works as expected with the snippet code from Sorry about the mix-up! 😬 |
No worries @tibineagu , thanks for testing! |
I am using latest version that is 0.10.2 version but still I am getting Error finding instanceID on window 1, can anyone guide me how to resolve that issue |
What is it?
Description
For some reason service worker is set to send messages to the latest client only. This leads to
error finding instance
, when user opens several tabs in the browser and switches not to the latest tab. More description here.Use cases and why
Open several tabs in the browser with the same site. Partytown should run with service worker, not Atomics.
Switch to the first tab. Now anytime web worker tries to send anything to the main thread, you'll get
error finding instance
. The problem is in below code, where service worker is set to send messages to the latest tab only.Checklist: