PerformanC / NodeLink

Performant LavaLink alternative written with Node.Js
BSD 2-Clause "Simplified" License
36 stars 22 forks source link

[BUG]: webSocketClosed on Long time usage #63

Closed ZuherLaith closed 2 months ago

ZuherLaith commented 2 months ago

NodeLink version

2.1.0 -- latest

Description

After leaving the client bot playing something for a long time (> 24hr) like lofi, I comeback to find that bot is in websocketClosed state (and no sound comes out from client bot) and only solution is to move bot to another channel and return it will output sound again and continue its intended work, Below are NL logs & Client logs:

[trackStart]: Study night • lofi ambient music | chill beats to relax/study to by HITO.
[getPlayer]: Received a request from client.
 Params: "/v4/sessions/xxxx/players/xxxx"
 Headers: {"accept-encoding":"br, gzip, deflate","user-agent":"FastLink","content-type":"application/json","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive"}
[voice]: Received a request from client.
 Params: "/v4/sessions/xxxx/players/xxxx"
 Headers: {"accept-encoding":"br, gzip, deflate","user-agent":"FastLink","content-type":"application/json","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
 Body: {"voice":{"token":"xxxx","endpoint":"dubai6530.discord.media:443","sessionId":"xxxx"}}
[voice]: Received a request from client.
 Params: "/v4/sessions/xxxx/players/xxxx"
 Headers: {"accept-encoding":"br, gzip, deflate","user-agent":"FastLink","content-type":"application/json","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
 Body: {"voice":{"token":"xxxx","endpoint":"rotterdam6246.discord.media:443","sessionId":"xxxx"}}
[voice]: Received a request from client.
 Params: "/v4/sessions/xxxx/players/xxxx"
 Headers: {"accept-encoding":"br, gzip, deflate","user-agent":"FastLink","content-type":"application/json","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
 Body: {"voice":{"token":"xxxx","endpoint":"rotterdam6246.discord.media:443","sessionId":"xxxx"}}
[voice]: Received a request from client.
 Params: "/v4/sessions/xxxx/players/xxxx"
 Headers: {"accept-encoding":"br, gzip, deflate","user-agent":"FastLink","content-type":"application/json","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
 Body: {"voice":{"token":"xxxx","endpoint":"dubai6530.discord.media:443","sessionId":"xxxx"}}
[FastLink] 127.0.0.1 has started a track
[LOG] Track Started, Time: 4:58:33 AM
[FastLink] 127.0.0.1 has received a trackEnd
[LOG] Track Ended, Time: 5:58:36 AM
// Client Already running for a stable > 24hr
[FastLink] 127.0.0.1 has started a track
[LOG] Track Started, Time: 5:58:37 AM
[FastLink] 127.0.0.1 has received a WebsocketClosed
[NL - WS] :: payload {
  node: {
    hostname: '127.0.0.1',
    secure: false,
    password: 'youshallnotpass',
    port: 2333,
    connected: true,
    sessionId: 'xxxx'
  },
  guildId: 'xxxx',
  payload: {
    op: 'event',
    type: 'WebSocketClosedEvent',
    guildId: 'xxxx',
    code: 4006,
    reason: 'Session no longer valid',
    byRemote: true
  }
}
[FastLink] 127.0.0.1 has received a WebsocketClosed
[NL - WS] :: payload {
  node: {
    hostname: '127.0.0.1',
    secure: false,
    password: 'youshallnotpass',
    port: 2333,
    connected: true,
    sessionId: 'xxxx'
  },
  guildId: 'xxxx',
  payload: {
    op: 'event',
    type: 'WebSocketClosedEvent',
    guildId: 'xxxx',
    code: 4006,
    reason: 'Session no longer valid',
    byRemote: true
  }
}

Client

FL 2.4.2

Steps to reproduce

Use FL & NL on a stable host for more than 24hr, you will see the result for sure.

Example code

No response

Confirmations

Code of Conduct

ThePedroo commented 2 months ago

Use 2.4.3 version (AKA current GitHub version) of FastLink.