IOS问题,电缆无法传送消息

os8fio9y  于 12个月前  发布在  iOS
关注(0)|答案(1)|浏览(111)

我们注意到,IOS版本为17.0.x的用户在Rails上使用网线时,几乎有50%的消息没有被发送。
我们收到以下消息。

D 2023-10-06T07:21:42.075Z context=node sid=kNJYv6SokFfI9dy9T1E9mK Perform result: &{[] false [] false []}
D 2023-10-06T07:21:42.198Z context=node sid=kNJYv6SokFfI9dy9T1E9mK Incoming message: &{message {"channel":"ConversationChannel","conversation_id":1512} {"action":"read"}}
W 2023-10-06T07:21:42.198Z context=node sid=kNJYv6SokFfI9dy9T1E9mK Unknown subscription {"channel":"ConversationChannel","conversation_id":1512}
D 2023-10-06T07:25:48.772Z context=node sid=kNJYv6SokFfI9dy9T1E9mK Websocket close error: websocket: close 1006 (abnormal closure): unexpected EOF
D 2023-10-06T07:25:48.772Z context=node sid=kNJYv6SokFfI9dy9T1E9mK websocket session completed
D 2023-10-06T07:25:48.772Z channel={"conversation_id":1512,"channel":"ConversationChannel"} context=hub sid=kNJYv6SokFfI9dy9T1E9mK Unsubscribed             
D 2023-10-06T07:25:48.772Z context=hub sid=kNJYv6SokFfI9dy9T1E9mK Unregistered             
D 2023-10-06T07:25:48.772Z context=node sid=kNJYv6SokFfI9dy9T1E9mK Disconnect {"current_user":"Z2lkOi8vbXlqb2Jub3cvVXNlci8zMzY4"} /cable [{"conversation_id":1512,"channel":"ConversationChannel"}]
D 2023-10-06T07:25:48.774Z context=rpc Disconnect response: status:SUCCESS 
D 2023-10-06T07:26:50.129Z context=rpc Authenticate response: status:SUCCESS identifiers:"{\"current_user\":\"Z2lkOi8vbXlqb2Jub3cvVXNlci8zMzY4\"}" transmissions:"{\"type\":\"welcome\"}" 
D 2023-10-06T07:26:50.129Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg websocket session established
D 2023-10-06T07:26:50.129Z context=hub sid=mAfQYjytdw5yO1QHHTJ1dg Registered with identifiers: {"current_user":"Z2lkOi8vbXlqb2Jub3cvVXNlci8zMzY4"}
D 2023-10-06T07:26:50.348Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{subscribe {"channel":"ConversationChannel","conversation_id":1512} }
D 2023-10-06T07:26:50.354Z context=rpc Command response: status:SUCCESS streams:"conversation_1512" transmissions:"{\"identifier\":\"{\\\"channel\\\":\\\"ConversationChannel\\\",\\\"conversation_id\\\":1512}\",\"type\":\"confirm_subscription\"}" 
D 2023-10-06T07:26:50.354Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Subscribed to channel: {"channel":"ConversationChannel","conversation_id":1512}
D 2023-10-06T07:26:50.354Z channel={"channel":"ConversationChannel","conversation_id":1512} context=hub sid=mAfQYjytdw5yO1QHHTJ1dg stream=conversation_1512 Subscribed               
D 2023-10-06T07:26:50.426Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"channel":"ConversationChannel","conversation_id":1512} {"action":"read"}}
D 2023-10-06T07:26:50.447Z context=rpc Command response: status:SUCCESS 
D 2023-10-06T07:26:50.447Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Perform result: &{[] false [] false []}
D 2023-10-06T07:27:05.902Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"channel":"ConversationChannel","conversation_id":1512} {"text":"Dsdwasdad","uuid":"EFFFEADD-40D3-4D68-8E39-1303F7E68B30","action":"send_message"}}
D 2023-10-06T07:27:05.994Z context=pubsub Incoming pubsub message from Redis: {"stream":"conversation_1512","data":"{\"action\":\"new_message\",\"payload\":{\"msg\":{\"text\":\"Dsdwasdad\"}}}"}
D 2023-10-06T07:27:05.994Z context=node Incoming pubsub message: &{conversation_1512 {"action":"new_message","payload":{"msg":{"text":"Dsdwasdad",}}}}
D 2023-10-06T07:27:05.994Z context=hub stream=conversation_1512 Broadcast message: {"action":"new_message","payload":{"msg":{"text":"Dsdwasdad",}}}}
D 2023-10-06T07:27:05.997Z context=rpc Command response: status:SUCCESS 
D 2023-10-06T07:27:05.997Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Perform result: &{[] false [] false []}
D 2023-10-06T07:27:06.130Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"channel":"ConversationChannel","conversation_id":1512} {"action":"read"}}
D 2023-10-06T07:27:06.150Z context=rpc Command response: status:SUCCESS 
D 2023-10-06T07:27:06.150Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Perform result: &{[] false [] false []}
D 2023-10-06T07:27:07.824Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"conversation_id":1512,"channel":"ConversationChannel"} {"uuid":"D192F95C-C20E-4B12-9D83-9076EE9CA378","text":"Dasdw","action":"send_message"}}
W 2023-10-06T07:27:07.824Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Unknown subscription {"conversation_id":1512,"channel":"ConversationChannel"}
D 2023-10-06T07:27:10.754Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"conversation_id":1512,"channel":"ConversationChannel"} {"text":"Dassss","uuid":"1FD4DF7F-6DD1-4326-AA50-87CFA917C7A7","action":"send_message"}}
W 2023-10-06T07:27:10.754Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Unknown subscription {"conversation_id":1512,"channel":"ConversationChannel"}
D 2023-10-06T07:27:13.166Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"channel":"ConversationChannel","conversation_id":1512} {"uuid":"E4053CD5-A614-4D51-8927-5D3E6D611875","text":"Dddwdwa","action":"send_message"}}
D 2023-10-06T07:27:13.239Z context=pubsub Incoming pubsub message from Redis: {"stream":"conversation_1512","data":"{\"action\":\"new_message\",\"payload\":{\"msg\":{\"text\":\"Dddwdwa\",}}
D 2023-10-06T07:27:13.239Z context=node Incoming pubsub message: &{conversation_1512 {"action":"new_message","payload":{"msg":{"text":"Dddwdwa""conversation_id":1512,"timestamp":"2023-10-06T07:27:13+00:00","uuid":"E4053CD5-A614-4D51-8927-5D3E6D611875","type":{"name":"text","text":"Dddwdwa"}}}}
D 2023-10-06T07:27:13.239Z context=hub stream=conversation_1512 Broadcast message: {"action":"new_message","payload":{"msg":{"text":"Dddwdwa","conversation_id":1512,"timestamp":"2023-10-06T07:27:13+00:00","uuid":"E4053CD5-A614-4D51-8927-5D3E6D611875","type":{"name":"text","text":"Dddwdwa"} }}}
D 2023-10-06T07:27:13.241Z context=rpc Command response: status:SUCCESS 
D 2023-10-06T07:27:13.241Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Perform result: &{[] false [] false []}
D 2023-10-06T07:27:13.375Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"channel":"ConversationChannel","conversation_id":1512} {"action":"read"}}
D 2023-10-06T07:27:13.396Z context=rpc Command response: status:SUCCESS 
D 2023-10-06T07:27:13.396Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Perform result: &{[] false [] false []}
D 2023-10-06T07:27:16.662Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"conversation_id":1512,"channel":"ConversationChannel"} {"action":"send_message","uuid":"E5618963-1CA1-4EB3-BAB9-196590F35A7B","text":"Asdwadasdwa"}}
W 2023-10-06T07:27:16.662Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Unknown subscription {"conversation_id":1512,"channel":"ConversationChannel"}
D 2023-10-06T07:27:26.078Z context=node sid=mAfQYjytdw5yO1QHHTJ1dg Incoming message: &{message {"channel":"ConversationChannel","conversation_id":1512} {"text":"Dsdsds\n","uuid":"C52C1FA9-B495-44C4-B4E4-2A8D97AEE4B9","action":"send_message"}}
D 2023-10-06T07:27:26.153Z context=pubsub Incoming pubsub message from Redis: {"stream":"conversation_1512","data":"{\"action\":\"new_message\",\"payload\":{\"msg\":{\"text\":\"Dsdsds\\n\"}

字符串
随附所执行测试的屏幕截图。
enter image description here
因此,这些消息不会发送给IOS用户。

库版本

服务器端:Rails v6,AnyCable v0.6.5
IOS Lib for Client WebSocket:** Redis (最初在v3.1.1上),然后在v4.0.6上问题仍然存在。
我们已经指出,问题可能是在IOS版本,因为在以前的版本
16.x,15.x**是没有任何问题的工作。此外,在Android和Web客户端没有任何问题。
任何见解/建议将在这里真的很有帮助。

1zmg4dgp

1zmg4dgp1#

问题是:

Subscribed to channel: {"channel":"ConversationChannel","conversation_id":1512}

...

Unknown subscription {"conversation_id":1512,"channel":"ConversationChannel"}

字符串
标识符(JSON编码的对象)中字段的顺序不同。
AnyCable将标识符视为字符串,它对内部内容没有任何假设(即,我们不解码JSON来查找通道)。
您使用的是哪个客户端库?它似乎没有重用标识符,而是在每次发送命令时对{channel, conversation_id}对象执行JSON编码-这是错误的。
还有,
AnyCable v0.6.5
是宝石版吗?反正太老了(虽然没关系,我想)

相关问题