Androz2091 / insta.js

šŸ’¬ Object-oriented library for sending and receiving messages via Instagram
138 stars 42 forks source link

Fixes IgCookieNotFoundError: Cookie sessionid not found error after logout #57

Closed meseven closed 3 years ago

meseven commented 3 years ago

Hi,

After successfully logging in and logging out, I was getting the following error. This PR solves the problem.

ClientDisconnectedError: MQTToTClient got disconnected.
    at SafeSubscriber._next (/Users/mseven/Desktop/insta.js/node_modules/instagram_mqtt/dist/realtime/realtime.client.js:154:30)
    at SafeSubscriber.__tryOrUnsub (/Users/mseven/Desktop/insta.js/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.next (/Users/mseven/Desktop/insta.js/node_modules/rxjs/internal/Subscriber.js:143:22)
    at Subscriber._next (/Users/mseven/Desktop/insta.js/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/Users/mseven/Desktop/insta.js/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Subject.next (/Users/mseven/Desktop/insta.js/node_modules/rxjs/internal/Subject.js:60:25)
    at MQTToTClient.setDisconnected (/Users/mseven/Desktop/insta.js/node_modules/mqtts/dist/mqtt.client.js:330:30)
    at Object.disconnect (/Users/mseven/Desktop/insta.js/node_modules/mqtts/dist/mqtt.client.js:98:26)
    at TLSSocket.<anonymous> (/Users/mseven/Desktop/insta.js/node_modules/mqtts/dist/transport/tls.transport.js:36:52)
    at TLSSocket.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1223:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
IgCookieNotFoundError: Cookie "sessionid" not found
    at State.extractCookieValue (/Users/mseven/Desktop/insta.js/node_modules/instagram-private-api/dist/core/state.js:142:19)
    at RealtimeClient.constructConnection (/Users/mseven/Desktop/insta.js/node_modules/instagram_mqtt/dist/realtime/realtime.client.js:42:53)
    at MQTToTClient.payloadProvider [as connectPayloadProvider] (/Users/mseven/Desktop/insta.js/node_modules/instagram_mqtt/dist/realtime/realtime.client.js:92:22)
    at MQTToTClient.connect (/Users/mseven/Desktop/insta.js/node_modules/instagram_mqtt/dist/mqttot/mqttot.client.js:38:42)
    at MQTToTClient.setDisconnected (/Users/mseven/Desktop/insta.js/node_modules/mqtts/dist/mqtt.client.js:339:18)
    at Object.disconnect (/Users/mseven/Desktop/insta.js/node_modules/mqtts/dist/mqtt.client.js:98:26)
    at TLSSocket.<anonymous> (/Users/mseven/Desktop/insta.js/node_modules/mqtts/dist/transport/tls.transport.js:36:52)
    at TLSSocket.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1223:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
kashirin-dm commented 3 years ago

58

kashirin-dm commented 3 years ago

Works great!

Androz2091 commented 3 years ago

Thank you šŸ‘