Alex-Rose / fb-messenger-cli

fb-messenger-cli, console Facebook messenger
761 stars 99 forks source link

Crashing when trying to logout after resetting fb password #218

Closed nilsjha closed 4 years ago

nilsjha commented 5 years ago

The application terminates when trying to logout, after generating a new password on Facebook. Authentication seems to be in a stale state, as I'm also unable to list any conversations.

EDIT: The same crash happens after re-enabling 2FA on my account...

What I expected

Give login error for incorrect password, then ask for new credentials

What happened

Program runs seemingly fine, throws an exception and exits when trying to logout

Steps to reproduce

  1. Setup fb-messenger-cli with the old Facebook-password
  2. Close the application
  3. Reset the Facebook-password
  4. Restart fb-messenger-cli
  5. Run the /logout-command
  6. The program then throws an exception and exits

I'm using Facebook with Norwegian language, as observed with the timestamp below. Maybe this could be an isse ?

$ fb-messenger-cli
Last logon time: Fri Oct 04 2019 13:26:03 GMT+0200 (sentraleuropeisk sommartid)
Launching app...
Fetching conversations...
Select conversation :
> /help
/b /back /menu .... Get back to conversation selection
/q /exit /quit .... Quit the application
/logout ........... Exit and flush credentials
/s /switch [#] .... Quick switch to conversation number #
/search [query] ... Search your friends to chat
/v /view [#] ...... View the attachment by the number given after the type
/r /refresh ....... Refresh the current converation
/timestamp ........ Toggle timestamp for messages
/help ............. Print this message
> /logout
readline.js:1032
            throw err;
            ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at makeCallback (fs.js:137:11)
    at Object.unlink (fs.js:939:14)
    at Crypt.flush (/usr/local/lib/node_modules/fb-messenger-cli/lib/crypt.js:64:12)
    at InteractiveCli.exit (/usr/local/lib/node_modules/fb-messenger-cli/lib/interactive.js:555:15)
    at InteractiveCli.handleCommands (/usr/local/lib/node_modules/fb-messenger-cli/lib/interactive.js:406:25)
    at Interface.InteractiveCli.handler (/usr/local/lib/node_modules/fb-messenger-cli/lib/interactive.js:466:21)
    at Interface.emit (events.js:189:13)
    at Interface._onLine (readline.js:290:10)
    at Interface._line (readline.js:638:8)
    at Interface._ttyWrite (readline.js:919:14)
shahzebs commented 4 years ago

I had the same issue. I was using Node v13 and decided to switch to Node v6. It works fines with version 6.17.1. Except I cannot get it to refresh conversations automatically.

AlanSyue commented 4 years ago

@shahzebs @nilsjha same issue here: #224

There is some problems because

latest version of NPM‘s code is different from GitHub’s code

There is no callback function in

fs.unlink(path.resolve(__dirname, '../', this.filename)
nilsjha commented 4 years ago

Thanks for the update @AlanSyue !

I'll mark this as closed, as another user has created a new issue - and I am currently not using this program.