Skip to content

Conversation

sapphi-red
Copy link
Member

Description

No more log spamming with WebSocket connection to * failed: 🙂

I came up with an idea to eliminate the WebSocket pinging in the network tab and the connection error logs and this PR implements that idea.

This PR moves the pinging logic to a shared worker. This makes the connection error log and the network request to be output in a different location (at least for Chrome, haven't checked with other browsers). Except for that, everything should work the same.
Since the error log and the network requests won't be output in the (main) devtools, I guess this would reduce the memory consumption.

closes #16361

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Dec 24, 2024
@sapphi-red sapphi-red changed the title feat(client): ping in SharedWorker feat(client): ping from SharedWorker Dec 24, 2024
@bluwy bluwy added this to the 6.1 milestone Jan 2, 2025
@sapphi-red
Copy link
Member Author

I noticed that Safari 7-15 does not support Shared Worker 😢 I assumed that it's globally available...

@sapphi-red sapphi-red modified the milestones: 6.1, 7.0 Jan 22, 2025
@sapphi-red sapphi-red modified the milestones: 7.0, 7.1 May 28, 2025
@patak-dev
Copy link
Member

/ecosystem-ci run

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 25, 2025

Open in StackBlitz

npm i https://pkg.pr.new/vite@19057

commit: 78e1551

@vite-ecosystem-ci
Copy link

@sapphi-red sapphi-red merged commit 5c97c22 into vitejs:main Jul 28, 2025
18 checks passed
@sapphi-red sapphi-red deleted the feat/client-ping-in-shared-worker branch July 28, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-nice-to-have Not breaking anything but nice to have (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exponential Backoff for Failed Pings

3 participants