playframework / playframework/playframework
Outdated doc for Websockets
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 12.6k
- Forks
- 4k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 29
Description
Play Version (2.5.4)
API (Scala)
Operating System (MacOS 10.11)
Hello, I try to get familiar with WebSockets in Play. I am following https://www.playframework.com/documentation/2.5.x/ScalaWebSockets#closing-a-websocket. After a few hours wasted I found out that this doc is probably outdated. In current Play you close Websocket connection by closing underlying akka-stream. Would be great if you can update docs accordingly.
Probably you don't need a reproducer because I feel it's expected behavior, but just in case:
Expected Behavior
- after sending
PoisonPillconnection is getting closed
Actual Behavior
after sending PoisonPill connection is not getting closed. I base that on:
- my client's callback onclose is not fired,
- Chrome's network Tab shows WS connection as Pending
Reproducible Test Case
you can see this code at https://github.com/note/play-ws-example, here's what is essential for this case: https://github.com/note/play-ws-example/blob/master/app/controllers/WebSocketController.scala. I also included my JS code here: https://github.com/note/play-ws-example/tree/master/client
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 with the Scala WebSockets documentation at the linked closing-a-websocket section and compare its guidance with app/controllers/WebSocketController.scala in the linked example. Check the client code and browser behavior described in the issue, then update the documentation to match the current connection-closing behavior and confirm the example's WebSocket closes as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, scala
- Domain
- documentation, networking
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100