【发布时间】:2016-12-25 08:30:32
【问题描述】:
远程 iOS 客户端成功连接到我,发送订阅命令(它工作正常),但在“取消订阅”命令我得到下一个错误:
退订频道:{"channel":"Assessor::StationChannel", "station_id": 1} 无法执行来自 {"command"=>"unsubscribe", "identifier"=>"{\"channel\":\"Assessor::StationChannel\", \"station_id\": 1}"}) [NoMethodError - nil:NilClass 的未定义方法“unsubscribe_from_channel”]:/app/vendor/bundle/ruby/2.2.0/gems/actioncable-5.0.0/lib/action_cable/connection/subscriptions.rb:44:in `remove_subscription' | /app/vendor/bundle/ruby/2.2.0/gems/actioncable-5.0.0/lib/action_cable/connection/subscriptions.rb:40:in `remove' | /app/vendor/bundle/ruby/2.2.0/gems/actioncable-5.0.0/lib/action_cable/connection/subscriptions.rb:16:in `execute_command' | /app/vendor/bundle/ruby/2.2.0/gems/actioncable-5.0.0/lib/action_cable/connection/base.rb:88:in `dispatch_websocket_message' | /app/vendor/bundle/ruby/2.2.0/gems/actioncable-5.0.0/lib/action_cable/server/worker.rb:58:in `block in invoke'订阅消息格式:
{"command": "subscribe", "identifier": "{\"channel\":\"Assessor::StationChannel\", \"station_id\": 1}"}退订消息格式:
{"command": "unsubscribe", "identifier": "{\"channel\":\"Assessor::StationChannel\", \"station_id\": 1}"}我无法在本地主机上重现此问题,所以也许有人可以帮助我?
【问题讨论】:
-
您能否格式化您的错误消息和命令以消除滚动。
-
你有没有想过清理和断开连接的正确方法是什么?在移动客户端/ios 的上下文中
标签: ios ruby-on-rails ruby websocket actioncable