Closed Ektaros closed 4 years ago
There's no payload. This is now properly rejected (0.2.9). In 0.2.9, this will result in an infinite reconnect loop.
Reset your fbns state.
Added notice in 0.2.10
.
Thanks for the updates. Tested it here are the results:
New Empty auth packet. Try resetting your fbns state!
is stiil an unhandeled rejection. I think it sould reject the original fbns.connect
promise if possible or not throw the error (cause it is useless anyway) and just return. Emitted notice should be enought.
If by 'reset fbns state' you mean create a new FbnsClient - this has no effect. Connection still fails. If not can u explain what exactly u mean by 'reset fbns state'? update: This has an effect. After several tries all problematic accounts were able to connect properly.
is stiil an unhandeled rejection
This is now rejected earlier.
If by 'reset fbns state' you mean create a new FbnsClient - this has no effect.
You are probably loading the auth. Don't do this. If you use ig.importState(), you can delete the fbns key. Currently, the client is somewhat unstable only 50% of connections succeed.
Yes it is unstable indeed. Solved by using promise.race with timeouts and infinite retrying. Any ideas on what could be the reason of instability?
Any ideas on what could be the reason of instability?
I don't know. Probably some race condition.
In new 0.2.11 there are no unhandled rejections but succesful realtime.connect() now emits error
error: {
name: 'Error',
message: 'CONNACK returnCode: 0 errorName: Connection accepted',
stack: 'Error: CONNACK returnCode: 0 errorName: Connection accepted\n' +
' at Object.next (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\instagram_mqtt\\src\\mqttot\\mqttot.client.ts:78:24)\n' +
' at MQTToTClient.continueFlows (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:271:49)\n' +
' at MQTToTClient.handlePacket (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:358:19)\n' +
' at C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:310:43\n' +
' at Array.forEach (<anonymous>)\n' +
' at MQTToTClient.parseData (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:310:25)\n' +
' at processTicksAndRejections (internal/process/task_queues.js:93:5)'
}
but succesful realtime.connect() now emits error
Your payload is probably empty. There's now a proper error and the fbns client should now be more stable.
The payload is empty indeed. Here is how the packet looks:
ConnectResponsePacket {
packetFlags: 0,
remainingPacketLength: 2,
_packetType: 2,
_flags: 0,
_returnCode: 0
}
But this error seems to be a mistake cause realtime client work properly:
ig:mqtt:realtime Connecting to realtime-broker... +0ms
ig:mqtt:realtime Overriding: +2ms
ig:mqtt:mqttot edge-mqtt.facebook.com:443: Creating client +0ms
mqtt:client Connecting... +0ms
mqtt:client:packet Sent MQTToTConnectRequestPacket +0ms
mqtt:client:packet Received ConnectResponsePacket +164ms
mqtt:client Connected! +268ms
mqtt:client Starting keep-alive-ping {delay: 19.5} +3ms
ig:mqtt:realtime Connected. Checking initial subs. +306ms
ig:mqtt:realtime Subscribing with Skywalker to ig/u/v1/19787707664 +1ms
ig:mqtt:realtime Iris Sub to: seqId: 2444, snapshot: 1585415906280 +1ms
error: {
name: 'Error',
message: 'CONNACK returnCode: 0 errorName: Connection accepted',
stack: 'Error: CONNACK returnCode: 0 errorName: Connection accepted\n' +
' at Object.next (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\instagram_mqtt\\src\\mqttot\\mqttot.client.ts:79:10)\n' +
' at MQTToTClient.continueFlows (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:271:49)\n' +
' at MQTToTClient.handlePacket (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:358:19)\n' +
' at C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:310:43\n' +
' at Array.forEach (<anonymous>)\n' +
' at MQTToTClient.parseData (C:\\Users\\mi\\Documents\\repos\\channels-manager-instagram\\node_modules\\mqtts\\src\\mqtt.client.ts:310:25)\n' +
' at processTicksAndRejections (internal/process/task_queues.js:93:5)'
}
mqtt:client:packet Sent PublishRequestPacket id: 1 topic: 88 +53ms
mqtt:client:packet Sent PublishRequestPacket id: 2 topic: 134 +1ms
mqtt:client:packet Received PublishAckPacket id: 1 +140ms
mqtt:client:packet Received PublishRequestPacket topic: 150 +12ms
mqtt:client:packet Received PublishAckPacket id: 2 +56ms
mqtt:client:ping PingPong @ 1585415926524 +0ms
mqtt:client:ping PingPong @ 1585415946026 +20s
mqtt:client:packet Received PublishRequestPacket id: 6419 topic: 88 +53s --someone is writing
mqtt:client:packet Sent PublishAckPacket id: 6419 +1ms
mqtt:client:packet Received PublishRequestPacket id: 6420 topic: 146 +808ms --recieved a message
mqtt:client:packet Sent PublishAckPacket id: 6420 +2ms
realtime client
Would be nice to say that earlier.
I did
I did
nvm it's fixed now
Nice ty. Back to testing :)
When calling fbns.connet() there is and unhandeled error and fbns fails to connect. This is consistent and happens every time, but not with every account. Started seeing such behavior 1 day ago. Here are the logs. Just for sience tried using code from example - same result
the raw
res
inthis.client.$connect.subscribe
callback :Something chaneged on isntagram's side?