Open ioquatix opened 3 hours ago
Hello, I tried to solve the issue.
This is what I did:
Modified Connection::Base to expose server as a public method. Updated Channel::Base to access server through the connection. This change allows channels to access the server without using ActionCable.server, making testing easier and avoiding potential issues with parallel tests.
You can review changes in this commit: https://github.com/lattaai13/anycable-actioncable-next-5/commit/57114377e376dcc993d28e7d48020f4929735ebb.
[!CAUTION] Disclaimer: The commit was created by Latta AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.
This issue was tried to solve for free by Latta AI - https://latta.ai/ourmission
If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.
ActionCable.server
inChannel
instances is a code smell. It makes testing more difficult than it should be (parallel tests might have more than one server).I think
Connection
should exposeserver
, e.g.I don't think we should encourage users to write
ActionCable.server
except as a last resort.