Undocumented breaking changes + better support for mocking client connections and message streams to protect against them #71
-
First, thank you for providing this library and the other async tools for Ruby. I know how much work goes into managing an open source library, never mind a suite of them plus your other projects. I bring this up not as a criticism but in the hopes of making the project better and let you know of a particular pain point I'm experiencing. I've got async (1.30.1)
console (~> 1.10)
nio4r (~> 2.3)
timers (~> 4.1)
async-http (0.56.5)
async (>= 1.25)
async-io (>= 1.28)
async-pool (>= 0.2)
protocol-http (~> 0.22.0)
protocol-http1 (~> 0.14.0)
protocol-http2 (~> 0.14.0)
async-io (1.32.2)
async
async-pool (0.3.9)
async (>= 1.25)
async-websocket (0.19.0)
async-http (~> 0.54)
async-io (~> 1.23)
protocol-websocket (~> 0.7.0) and async (2.12.1)
console (~> 1.25, >= 1.25.2)
fiber-annotation
io-event (~> 1.6, >= 1.6.5)
async-http (0.69.0)
async (>= 2.10.2)
async-pool (~> 0.7)
io-endpoint (~> 0.11)
io-stream (~> 0.4)
protocol-http (~> 0.26)
protocol-http1 (~> 0.19)
protocol-http2 (~> 0.18)
traces (>= 0.10)
async-pool (0.7.0)
async (>= 1.25)
async-websocket (0.26.2)
async-http (~> 0.54)
protocol-rack (~> 0.5)
protocol-websocket (~> 0.14) the format of the message returned from Async::WebSocket::Client.connect(endpoint) do |connection|
while (message = connection.read) changed from a Hash-like object that allowed direct access to message keys like We still haven't got it back up and running fully, but troubleshooting it locally is difficult as there are no complete guides or built-in methods to mock an Async::Websocket connection and a message IO stream in tests, and stubbing them manually involves jumping through numerous dependent libraries to try to figure out what other I'd like to ask two things of this project:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 15 replies
-
That's fair, it was a huge breaking change. I don't think there will be any other major changes to the interface going forward. I agree with your suggestions. Regarding mocking, would it be sufficient just to replay a set of messages? |
Beta Was this translation helpful? Give feedback.
-
Another breaking change I just discovered where this used to work: Async::WebSocket::Client.connect(endpoint) do |connection|
while (message = connection.read)
if message[:envelope_id]
connection.write({ envelope_id: message[:envelope_id] }) it now needs to be Async::WebSocket::Client.connect(endpoint) do |connection|
while (payload = connection.read)
message = payload.parse(Protocol::WebSocket::Coder::JSON.new(symbolize_names: true))
if message[:envelope_id]
Protocol::WebSocket::TextMessage.generate({ envelope_id: message[:envelope_id] }).send(connection) That took me forever to figure out |
Beta Was this translation helpful? Give feedback.
-
Another breaking change. Not sure if this was in async-websockets or one its dependencies, but with roughly this combination of gems...
...you could call Just to reiterate, I would not expect minor version changes to introduce breaking changes to working apps, and if for some reason they had to, I'd expect to see some documentation about what changed. |
Beta Was this translation helpful? Give feedback.
Ah, interesting! Thanks for the explanation! That should help me clean the code up a bit more.