fix(RemoteAuth): pass session name to store.save instead of full path#201660
Open
Adi1231234 wants to merge 4 commits intowwebjs:mainfrom
Open
fix(RemoteAuth): pass session name to store.save instead of full path#201660Adi1231234 wants to merge 4 commits intowwebjs:mainfrom
Adi1231234 wants to merge 4 commits intowwebjs:mainfrom
Conversation
store.save() was receiving path.join(this.dataPath, this.sessionName) instead of just this.sessionName. This caused remote stores (e.g. S3) to use the full local filesystem path as the storage key, resulting in zip files being saved under paths like: sessions/Users/user/project/.wwebjs_session/default/RemoteAuth-default.zip instead of: sessions/RemoteAuth-default.zip all other store calls (sessionExists, extract, delete) already pass this.sessionName correctly. This brings store.save in line with them. the local filesystem operations (creating and cleaning up the zip file) continue to use path.join(this.dataPath, ...) which is correct. regression introduced in e6fd112.
sofi-ans
approved these changes
Mar 15, 2026
BenyFilho
approved these changes
Mar 15, 2026
Adi1231234
added a commit
to Adi1231234/whatsapp-web.js
that referenced
this pull request
Mar 16, 2026
…127083 - RemoteAuth: pass session name directly to store.save instead of full path (fixes PR wwebjs#201660 - path.join was passing the full filesystem path instead of just the session identifier) - Client: register framenavigated listener before calling inject() so any page navigation that occurs during initialization is captured (fixes PR wwebjs#127083 ordering issue)
Adi1231234
added a commit
to Adi1231234/whatsapp-web.js
that referenced
this pull request
Mar 16, 2026
…127083 (#65) - RemoteAuth: pass session name directly to store.save instead of full path (fixes PR wwebjs#201660 - path.join was passing the full filesystem path instead of just the session identifier) - Client: register framenavigated listener before calling inject() so any page navigation that occurs during initialization is captured (fixes PR wwebjs#127083 ordering issue)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
store.save()instoreRemoteSessionis passingpath.join(this.dataPath, this.sessionName)as the session identifier, but every other store call in the file (sessionExists,extract,delete) passes justthis.sessionName. Because of this mismatch, the session gets saved under the full local filesystem path as the remote key, so on the next startupsessionExistscan't find it and the session is lost.This is what people end up seeing in S3 (or any other remote store):
instead of:
The
path.join(this.dataPath, ...)part makes sense for the actual zip file on disk, andcompressSessionalready handles that correctly. Thesession:parameter is just the remote key, it has nothing to do with where the zip lives locally.Fix is a one-liner: pass
this.sessionNametostore.save(), same as the other three store calls.Regression introduced in e6fd112. Working on 1.36.2, broken on 1.36.4.