Remora / Remora.Discord

A data-oriented C# Discord library, focused on high-performance concurrency and robust design.
GNU Lesser General Public License v3.0
246 stars 44 forks source link

[Bug]: Not receiving any gateway events #301

Closed pititu closed 1 year ago

pititu commented 1 year ago

Description

I'm getting the following error after connecting to the gateway:

ExceptionError 
{
    Message = The buffer writer has advanced too far.,
    Exception = System.ArgumentException: The buffer writer has advanced too far.
   at CommunityToolkit.HighPerformance.Buffers.ArrayPoolBufferWriter`1.ThrowArgumentExceptionForAdvancedTooFar()
   at CommunityToolkit.HighPerformance.Buffers.ArrayPoolBufferWriter`1.Advance(Int32 count)
   at Remora.Discord.Gateway.Transport.WebSocketPayloadTransportService.ReceivePayloadAsync(CancellationToken ct)
   at Remora.Discord.Gateway.DiscordGatewayClient.GatewayReceiverAsync(TimeSpan heartbeatInterval, CancellationToken disconnectRequested)
}

Steps to Reproduce

  1. Call DiscordGatewayClient#RunAsync
  2. Inspect the returned Result

Expected Behavior

The client to successfully connect to the gateway and start receiving events.

Current Behavior

The client connects to the gateway but doesn't receive any events.

Library / Runtime Information

Remora.Discord.Gateway: 11.0.6-github4719511397

Nihlus commented 1 year ago

@VelvetThePanda

VelvetToroyashi commented 1 year ago

This code was taken from my old library, and should have worked, but I'll take a look into this regardless https://github.com/VelvetThePanda/FurCord.NET/blob/master/src/FurCord.NET/Net/Clients/Websocket/WebSocketClient.cs

VelvetToroyashi commented 1 year ago

Private repo, oops. I fixed the issue locally; will PR the changes image

VelvetToroyashi commented 1 year ago

This should be fixed in the latest nightly, sorry for the trouble!

pititu commented 1 year ago

Works fine now. Thanks.