Skip to content

Commit 6c76d06

Browse files
Fix decoding of MessagePack data
websocket-driver 0.8 changed the format in which it emits binary data [1]: > Emit binary message as a string with Encoding::BINARY instead of an array > Add the option :binary_data_format to force the previous behaviour [1] https://github.com/faye/websocket-driver-ruby/blob/main/CHANGELOG.md#080--2025-05-25
1 parent 1cc570b commit 6c76d06

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

ably.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Gem::Specification.new do |spec|
2525
spec.add_runtime_dependency 'faraday-typhoeus', '~> 0.2.0'
2626
spec.add_runtime_dependency 'typhoeus', '~> 1.4'
2727
spec.add_runtime_dependency 'json'
28-
spec.add_runtime_dependency 'websocket-driver', '~> 0.7'
28+
# We disallow minor version updates, because this gem has introduced breaking API changes in minor releases before (which it's within its rights to do, given it's pre-v1). If you want to allow a new minor version, bump here and run the tests.
29+
spec.add_runtime_dependency 'websocket-driver', '~> 0.8.0'
2930
spec.add_runtime_dependency 'msgpack', '>= 1.3.0'
3031
spec.add_runtime_dependency 'addressable', '>= 2.0.0'
3132

lib/ably/realtime/connection/websocket_transport.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def parse_event_data(data)
257257
when :json
258258
JSON.parse(data)
259259
when :msgpack
260-
MessagePack.unpack(data.pack('C*'))
260+
MessagePack.unpack(data)
261261
else
262262
client.logger.fatal { "WebsocketTransport: Unsupported Protocol Message format #{client.protocol}" }
263263
data

0 commit comments

Comments
 (0)