[PR #4127] [MERGED] Prevent generating an error during ws close #20215

Closed
opened 2026-04-25 22:23:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/4127
Author: @BlackDex
Created: 12/4/2023
Status: Merged
Merged: 12/4/2023
Merged by: @dani-garcia

Base: mainHead: fix-websocket-close-issue


📝 Commits (1)

  • a8d664e Prevent generating an error during ws close

📊 Changes

1 file changed (+10 additions, -0 deletions)

View changed files

📝 src/api/notifications.rs (+10 -0)

📄 Description

When a WebSocket connection was closing it was sending a message after it was closed already. This generated an error in the logs. While this error didn't harm any of the functionallity of Vaultwarden it isn't nice to see them of course.

This PR Fixes this by catching the close message and breaks the loop at that point. This prevents the _ catch-all from replying the close message back to the client, which was causing the error message.

Fixes #4090


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/4127 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 12/4/2023 **Status:** ✅ Merged **Merged:** 12/4/2023 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `fix-websocket-close-issue` --- ### 📝 Commits (1) - [`a8d664e`](https://github.com/dani-garcia/vaultwarden/commit/a8d664e1fed9fa0817e29970728613c85046f8cb) Prevent generating an error during ws close ### 📊 Changes **1 file changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/api/notifications.rs` (+10 -0) </details> ### 📄 Description When a WebSocket connection was closing it was sending a message after it was closed already. This generated an error in the logs. While this error didn't harm any of the functionallity of Vaultwarden it isn't nice to see them of course. This PR Fixes this by catching the close message and breaks the loop at that point. This prevents the `_` catch-all from replying the close message back to the client, which was causing the error message. Fixes #4090 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 22:23:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#20215