mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-07 12:34:03 -05:00
[PR #6935] [CLOSED] Fix duplicate AuthRequestResponse notification on approving device #12737
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/6935
Author: @xjohnyknox
Created: 3/13/2026
Status: ❌ Closed
Base:
main← Head:fix/auth-response-duplicate-notification📝 Commits (1)
ae53286Fix duplicate AuthRequestResponse notification on approving device📊 Changes
1 file changed (+5 additions, -9 deletions)
View changed files
📝
src/api/notifications.rs(+5 -9)📄 Description
Summary
When approving a login-with-device request,
nt.send_auth_response()broadcasts anAuthRequestResponse(type 16) through the authenticated WebSocket hub to all user devices — including the approving device itself. This causes a duplicate auth request notification on Android.Root cause
In
put_auth_request, two notification calls are made after approval:The authenticated WebSocket hub (
self.send_update(user_id, &data)) sends to every connected device of the user, including Device B (the approving device), which should not receiveAuthRequestResponseat all.How the official Bitwarden server handles this
Per the official server code (
HubHelpers.cs),AuthRequestResponse(type 16) is sent only through_anonymousHubContexttoGroup(AuthRequest.Id). It is not sent through the authenticated_hubContext. This is the key difference fromAuthRequest(type 15), which uses_hubContext.Clients.User().Fix
Remove the authenticated WebSocket broadcast from
send_auth_response(), keeping only the push relay call as a fallback for devices not connected via WebSocket. The anonymous hub (ant.send_auth_response) already handles WebSocket delivery to the requesting device.Test plan
Fixes #6788
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.