Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix remote auth #2412

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

nkbhasker
Copy link

@nkbhasker nkbhasker commented Aug 17, 2023

PR Details

Remote auth session not getting restored.

Description

Related Issue

closes #2038, closes #1681, closes #2530, closes #2452

Motivation and Context

How Has This Been Tested

  1. Mongo Store - This was tested with Mongo store as described in the documentation.
  2. AWS S3 Store - I have also tested this with a new s3 store.

Types of changes

  • Dependency change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (index.d.ts).

Copy link

@steven-tib steven-tib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested it and it seem to work fine, tested on heroku server, I forced restart the server multiple times and it then reloads the previous session instead of sending continuously new QR codes.

@flaviobogila
Copy link

It don't work for me too. I can't restore the session from remote auth using mongo lib, after the whatsapp version 2.2334.12

@mrfelipemartins
Copy link
Contributor

@nkbhasker Why dou you think that the problem was the unzipper package? I have a server running with 34 devices under RemoteAuth, I have a issue where only ~30% of the sessions are restored after restarts. I tested your solution and my results are the same as before. I also tested locally with 2 devices and with both adm-zip and unzipper it worked the same. In my opinion there is something else causing problems with RemoteAuth. I am trying to debug it and will be happy to bring a feedback, but I would like to hear from you why you think that changing the unzip package could solve the problem! Thanks for contributing!

@OptiMus-cyber-2
Copy link

@nkbhasker Why dou you think that the problem was the unzipper package? I have a server running with 34 devices under RemoteAuth, I have a issue where only ~30% of the sessions are restored after restarts. I tested your solution and my results are the same as before. I also tested locally with 2 devices and with both adm-zip and unzipper it worked the same. In my opinion there is something else causing problems with RemoteAuth. I am trying to debug it and will be happy to bring a feedback, but I would like to hear from you why you think that changing the unzip package could solve the problem! Thanks for contributing!

I have tested the solution its working. I have tested the unzipping with unzipper. That's not properly unzipping the file. That's lead not to restore the session.
Things completely got changed with using adm-zip and unzipper. If you merge the commit, it would be helpful for alll to use the library.

@OptiMus-cyber-2
Copy link

@nkbhasker Why dou you think that the problem was the unzipper package? I have a server running with 34 devices under RemoteAuth, I have a issue where only ~30% of the sessions are restored after restarts. I tested your solution and my results are the same as before. I also tested locally with 2 devices and with both adm-zip and unzipper it worked the same. In my opinion there is something else causing problems with RemoteAuth. I am trying to debug it and will be happy to bring a feedback, but I would like to hear from you why you think that changing the unzip package could solve the problem! Thanks for contributing!

I have tested the solution its working. I have tested the unzipping with unzipper. That's not properly unzipping the file. That's lead not to restore the session. Things completely got changed with using adm-zip and unzipper. If you merge the commit, it would be helpful for alll to use the library.

May you give the option for unzipping as parameter in Remoteauth.

@tuyuribr
Copy link
Collaborator

tuyuribr commented Sep 4, 2023

@nkbhasker Why dou you think that the problem was the unzipper package? I have a server running with 34 devices under RemoteAuth, I have a issue where only ~30% of the sessions are restored after restarts. I tested your solution and my results are the same as before. I also tested locally with 2 devices and with both adm-zip and unzipper it worked the same. In my opinion there is something else causing problems with RemoteAuth. I am trying to debug it and will be happy to bring a feedback, but I would like to hear from you why you think that changing the unzip package could solve the problem! Thanks for contributing!

Ye, I think the problem might be the save interval instead of unzipper

@bmmangukiya
Copy link

Fix: Resolve issue by downgrading Node.js version, removing old dependencies, and reinstalling

The problem was caused by using Node.js version 18, which caused compatibility issues with the project. After downgrading to Node.js version 16, removing old dependencies (old 'node_modules' directory and 'package-lock.json'), and reinstalling dependencies with 'npm install,' the issue is now resolved.

  • Changed Node.js version from 18 to 16.
  • Removed the old 'node_modules' directory and 'package-lock.json' file.
  • Ran 'npm install' to reinstall project dependencies.

@longgtruong
Copy link

will this ever be merged or fixed? RemoteAuth is pretty essential feature

downgrading node is simply not a solution

@thereis
Copy link

thereis commented Nov 20, 2023

@pedroslopez can you take a look on that please?

@GT-Eric
Copy link

GT-Eric commented Nov 23, 2023

This fix actually worked for me. What @nkbhasker mention is possible. But I'm not really sure about the specific reason why the uncompression for unzipper doesn't work and works for adm.

Repository owner deleted a comment from tuyuribr Dec 5, 2023
@klmz
Copy link

klmz commented Jan 12, 2024

I've tested this combined with this library: https://github.com/Tots-Agency/wwebjs-google-cloud-storage and this is working.

Copy link

@Monjes-A Monjes-A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me funcionó en aws

@gg3083
Copy link

gg3083 commented Jan 23, 2024

test work

@viniciusbig
Copy link

It seems to be working now.
any change to have this merged?

@roysG
Copy link

roysG commented Jan 26, 2024

Works perfectly, but... in case you will start another logged session in other server.. then it cause to messages stop sending.
The only fix for this is to delete the folder from the S3.

@ravikant-pal
Copy link

@pedroslopez will this ever be merged or fixed?
Yes, @longgtruong RemoteAuth is a pretty essential feature
@pedroslopez please 🙏 look into it

@outaTiME
Copy link

outaTiME commented Feb 13, 2024

Yay, it works perfectly with the wwebjs-aws-s3 extension and node18, it would be of utmost importance to approve the PR to avoid the patch 🙌

@zanatahenry
Copy link

This worked perfectly for me, using the wwebjs-mongo extension.

Copy link

@hirebarend hirebarend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with AWS S3, Mongo and another custom store and it works

@Har1ha
Copy link

Har1ha commented Mar 29, 2024

adm zip loads up too much memory when i restart it was stuck at remote connected, hopefully I do not see QR code but the problem is the zipper

I'm using node version 20.11.1

@edmilson-dk
Copy link

#2631 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet