Remora/Remora.Discord

[Bug]: Not receiving any gateway events

pititu opened this issue · 5 comments

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

@VelvetThePanda

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

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

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

Works fine now. Thanks.