Skip to content
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(client): detect ws close correctly #18548

Merged

Conversation

sapphi-red
Copy link
Member

Description

The client was checking wasClean property of the close event to detect WebSocket disconnection on top-level navigation (#1872). But wasClean: true can happen for other reasons.

I changed that condition to use a variable set by beforeUnload event.

Applying this patch makes sapphi-red/vite-setup-catalogue#13 pass (sapphi-red/vite-setup-catalogue@3fa0baa).

@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Nov 1, 2024
@patak-dev patak-dev merged commit 637d31b into vitejs:main Nov 1, 2024
16 checks passed
@sapphi-red sapphi-red deleted the fix/client-detect-ws-close-correctly branch November 1, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants