Skip to content

LavalinkNodeConnection is cached before a successful connection is made #321

@Kriste00

Description

@Kriste00

Summary

The LavaLinkExtention will cache a LavalinkNodeConnection even if the connection to the socket was not successful.

Details

Example:
Line 53: The connection is not cached.
Line 59: The connection gets put into the cache.
Line 60: The connection fails (Network issue, ect)

Bug: The connection is still in the cache and will be returned on the next ConnectAsync call.

if (this.ConnectedNodes.ContainsKey(config.SocketEndpoint))
return this.ConnectedNodes[config.SocketEndpoint];
var con = new LavalinkNodeConnection(this.Client, config);
con.NodeDisconnected += this.Con_NodeDisconnected;
con.Disconnected += this.Con_Disconnected;
this.ConnectedNodes[con.NodeEndpoint] = con;
await con.StartAsync().ConfigureAwait(false);
return con;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions