WebSocketSubject: Keep-Alive and messages queue
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31.7k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Description
Hi mates,
i implemented keep-alive with ping pong pattern for check the connection state (because in some situation websocket believes to be connected but it really is not (for example by disconnecting the network cable). When client websocket send a ping to server, the server send a pong so client can know if the trasport channel is really up. In the event that the client does not notice that it is disconnected instead it send a ping and no pong receive (because server is unreachable) safter a while the client tries to postpone another ping and retry so on... so many ping are queued in WebSocketSubject queue (destination is a ReplaySubject unlimited). So when server come up, client send all ping queued :(
Is there a way not to queue the pings in the queue? I see destination parameter in WebSocketSubject ctor but i don't know ad is works. Can you help me? Can i send a message without appending it in the queue?
Thank you
Version:
"rxjs": "^6.5.3",
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the WebSocketSubject implementation and its constructor's destination parameter, then reproduce the disconnected-network scenario described in the issue. Determine how queued messages are handled when the connection returns and define completion as preventing stale keep-alive pings from being sent, with coverage for the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100