-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Minor: Event handler of 'offline' event must be added on the initial evaluation of worker script on Service Worker #5125
Comments
Hi! The "offline" event listener is added here: https://github.com/socketio/engine.io-client/blob/fa479164251dd1f283dd163143b546582161339a/lib/socket.ts#L397 |
Is there a milestone for this fix? I just installed socket.io (current version being 4.7.5) and I'm encountering this very same warning. |
@FMaz008 out of curiosity, could you please explain your use case? Why use a ServiceWorker and not a SharedWorker? |
Honestly everything works fine with the Service Worker coupled with an Alarm. That and I had never heard of a Shared Worker before today. So it seems I'm just outdated a bit on my knowledge here. (Not to side track the conversation, but I tried implementing a SharedWorker, but I keep getting a security error. But even assuming I could sort out this problem, it would be a major refactor of the existing code if it worked.) |
For future readers: This should be fixed by 8a2f5a3, included in |
Describe the bug
Getting a warning when including socket.io client to service worker:
Event handler of 'offline' event must be added on the initial evaluation of worker script on Service Worker
To Reproduce
Socket.IO server version:
4.7.4
Server
Socket.IO client version:
4.7.4
Client
Expected behavior
Probably can skip adding "offline" event listener for service worker, since it's already skipped it for offline, I don't see any harm skipping it for service worker.
Platform:
Additional context
I would like to contribute myself but I can't find the exact line to modify. I can find the codes in dist/socket.io.js but I'm not sure if that's the right file.
The text was updated successfully, but these errors were encountered: