facebook-chat-api icon indicating copy to clipboard operation
facebook-chat-api copied to clipboard

Unable to log in after getting switched to "New Facebook"

Open DanH42 opened this issue 4 years ago • 5 comments

My account was just moved without warning over to Facebook's new half-baked web UI and isn't being given the option to switch back. Since that happened, my bot is unable to log in, displaying the following:

info login Done logging in.
ERR! getSeqId TypeError: Cannot read property 'successful_results' of undefined
ERR! getSeqId     at defaultFuncs.post.then.then (/home/node/node_modules/facebook-chat-api/src/listenMqtt.js:532:41)
ERR! getSeqId     at tryCatcher (/home/node/node_modules/bluebird/js/release/util.js:16:23)
ERR! getSeqId     at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:547:31)
ERR! getSeqId     at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
ERR! getSeqId     at Promise._settlePromise0 (/home/node/node_modules/bluebird/js/release/promise.js:649:10)
ERR! getSeqId     at Promise._settlePromises (/home/node/node_modules/bluebird/js/release/promise.js:729:18)
ERR! getSeqId     at Promise._fulfill (/home/node/node_modules/bluebird/js/release/promise.js:673:18)
ERR! getSeqId     at Promise._resolveCallback (/home/node/node_modules/bluebird/js/release/promise.js:489:14)
ERR! getSeqId     at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:559:17)
ERR! getSeqId     at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
ERR! getSeqId     at Promise._settlePromise0 (/home/node/node_modules/bluebird/js/release/promise.js:649:10)
ERR! getSeqId     at Promise._settlePromises (/home/node/node_modules/bluebird/js/release/promise.js:729:18)
ERR! getSeqId     at Promise._fulfill (/home/node/node_modules/bluebird/js/release/promise.js:673:18)
ERR! getSeqId     at Promise._resolveCallback (/home/node/node_modules/bluebird/js/release/promise.js:466:57)
ERR! getSeqId     at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:559:17)
ERR! getSeqId     at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
ERR! getSeqId  TypeError: Cannot read property 'successful_results' of undefined
ERR! getSeqId     at defaultFuncs.post.then.then (/home/node/node_modules/facebook-chat-api/src/listenMqtt.js:532:41)
ERR! getSeqId     at tryCatcher (/home/node/node_modules/bluebird/js/release/util.js:16:23)
ERR! getSeqId     at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:547:31)
ERR! getSeqId     at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
ERR! getSeqId     at Promise._settlePromise0 (/home/node/node_modules/bluebird/js/release/promise.js:649:10)
ERR! getSeqId     at Promise._settlePromises (/home/node/node_modules/bluebird/js/release/promise.js:729:18)
ERR! getSeqId     at Promise._fulfill (/home/node/node_modules/bluebird/js/release/promise.js:673:18)
ERR! getSeqId     at Promise._resolveCallback (/home/node/node_modules/bluebird/js/release/promise.js:489:14)
ERR! getSeqId     at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:559:17)
ERR! getSeqId     at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
ERR! getSeqId     at Promise._settlePromise0 (/home/node/node_modules/bluebird/js/release/promise.js:649:10)
ERR! getSeqId     at Promise._settlePromises (/home/node/node_modules/bluebird/js/release/promise.js:729:18)
ERR! getSeqId     at Promise._fulfill (/home/node/node_modules/bluebird/js/release/promise.js:673:18)
ERR! getSeqId     at Promise._resolveCallback (/home/node/node_modules/bluebird/js/release/promise.js:466:57)
ERR! getSeqId     at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:559:17)
ERR! getSeqId     at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
TypeError: Cannot read property 'successful_results' of undefined
    at defaultFuncs.post.then.then (/home/node/node_modules/facebook-chat-api/src/listenMqtt.js:532:41)
    at tryCatcher (/home/node/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/node/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/node/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/home/node/node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (/home/node/node_modules/bluebird/js/release/promise.js:489:14)
    at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:559:17)
    at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/node/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/node/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/home/node/node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (/home/node/node_modules/bluebird/js/release/promise.js:466:57)
    at Promise._settlePromiseFromHandler (/home/node/node_modules/bluebird/js/release/promise.js:559:17)
    at Promise._settlePromise (/home/node/node_modules/bluebird/js/release/promise.js:604:18)

I'm running the latest v1.8.0 from NPM. I don't know what other info I can provide that would be helpful, but I'm happy to run whatever tests anyone suggests.

DanH42 avatar Jun 19 '20 17:06 DanH42

the issue is: if you switched to "New Facebook", the doc_id inside listenMqtt.js wouldn't work.

BadAimWeeb avatar Jun 20 '20 10:06 BadAimWeeb

That much makes sense, but I assume there's got to be more to it. If the doc_id is different, that indicates that the underlying GraphQL query has changed as well, and it's likely to return different data or require different parameters. At least, that would make sense.

I'd be happy to try swapping it out for a new value to see if that's really all it takes, but I'm having some trouble locating the doc_id in question. Looking at the network activity for an account that still has access to the "classic" UI, I'm not seeing any queries with a doc_id of either 1768656253222505 or 1349387578499440, nor am I seeing any that have parameters that line up with the two queries in listenMqtt.js. Without that, I'm not sure how else to identify a replacement doc_id as you seem to be suggesting.

And while it's certainly outside the scope of this project, I'd also be very open to any workarounds that would let me force an account back to the classic UI when it's not being given the option to do so. Even if it's just kicking this can a couple months down the road to when this hideous UI is inevitably rolled out to everyone, I'll take whatever I can get. I tried piecing together a curl request by hand that combined an opt-out request from another account (CometTrialParticipationChangeMutation) with the cookies and other profile-specific data of this account, and while I did get a response claiming that the operation was successful, it didn't have any effect.

DanH42 avatar Jun 20 '20 15:06 DanH42

indeed, different data are returned as well.

but, by using doc_id 3253745841302430 (or 3129882290383387), you can still get the seqID from the same location (it worked fine on listenMqtt with the seqID, but getThreadList? no. it needs some tweaks.)

see:

  • https://github.com/fca-unofficial/fca-unofficial/blob/master/src/listenMqtt.js#L770
  • https://github.com/fca-unofficial/fca-unofficial/blob/master/src/getThreadList.js#L195

yes it does affect getThreadList too, cuz getSeqId and getThreadList use the same doc_id

BadAimWeeb avatar Jun 20 '20 15:06 BadAimWeeb

Upvote this, Facebook is rolling out new UI and this issue hasn't been solved yet

royalgarter avatar Aug 13 '20 10:08 royalgarter

up

VanHop94 avatar Oct 23 '20 03:10 VanHop94