fix remote auth
PR Details
Remote auth session not getting restored.
Description
Related Issue
closes #2038, closes #1681, closes #2452
Motivation and Context
How Has This Been Tested
- Mongo Store - This was tested with Mongo store as described in the documentation.
- AWS S3 Store - I have also tested this with a new s3 store.
Types of changes
- [x] Dependency change
- [x] 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
- [x] My code follows the code style of this project.
- [ ] I have updated the documentation accordingly (index.d.ts).
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
@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!
@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.
@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.
@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
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.
will this ever be merged or fixed? RemoteAuth is pretty essential feature
downgrading node is simply not a solution
@pedroslopez can you take a look on that please?
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.
I've tested this combined with this library: https://github.com/Tots-Agency/wwebjs-google-cloud-storage and this is working.
test work
It seems to be working now. any change to have this merged?
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.
@pedroslopez will this ever be merged or fixed?
Yes, @longgtruong RemoteAuth is a pretty essential feature
@pedroslopez please 🙏 look into it
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 🙌
This worked perfectly for me, using the wwebjs-mongo extension.
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
https://github.com/pedroslopez/whatsapp-web.js/issues/2631#issuecomment-2028152897
Doesnt work for me.
Doesnt work for me.
Could you specify what exactly, what is the error do you have?
Working for me.
yarn remove whatsapp-web.js
yarn add nkbhasker/whatsapp-web.js#fix-remote-auth
Unfortunately, adm-zip doesn't support zip files larger than 2 gb
RangeError: File size (2561706669) is greater than 2 GiB
at new NodeError (node:internal/errors:405:5)
at tryCreateBuffer (node:fs:430:13)
at Object.readFileSync (node:fs:475:14)
at new module.exports (./node_modules/adm-zip/adm-zip.js:55:37)
[...]