Skip to content

Client.Client(connectionId) returing incorrect proxy connection #47189

@BobbyCannon

Description

@BobbyCannon

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The issue only happens on OnConnectedAsync. The issue does not happen on OnDisconnectedAsync and will work as expected.

image

Expected Behavior

When calling Clients.Client with a Connection Id, I would expect the correct client proxy to be returned.

Steps To Reproduce

Create a notification hub

public class NotificationHub : Hub, INotificationHub

Try to call another connected client when a different client is connecting.

public override async Task OnConnectedAsync()

When the first client is connecting in "OnConnectedAsync()", try to get the proxy of an existing connection via the Clients.Client(otherId). The current connecting connection proxy will be returned instead of the one requested.

var client = Clients.Client(connectionId);
await client.SendCoreAsync(nameof(SendSingleNotification), new object[] { message });

Exceptions (if any)

No response

.NET Version

7.0.201

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and servers

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions