mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-20 20:16:06 -04:00
[PR #26] [MERGED] fix: auto-reconnect if websocket stops sending messages #58
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stoatchat/javascript-client-sdk/pull/26
Author: @sussycatgirl
Created: 11/13/2021
Status: ✅ Merged
Merged: 1/4/2022
Merged by: @insertish
Base:
master← Head:master📝 Commits (1)
b142f86Duct tape fixed a websocket issue📊 Changes
2 files changed (+47 additions, -8 deletions)
View changed files
📝
src/Client.ts(+14 -0)📝
src/websocket/client.ts(+33 -8)📄 Description
This attempts to fix an issue where the client randomly stops receiving websocket messages for no apparent reason.
When
pongTimeoutis set in the client config, the client awaits aPongevent every time aPingis sent. If no Pong is received within the specified timeout window, the websocket client attempts to reconnect (Or optionally immediately exits).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.