fix(RemoteAuth): pass session name to store.save instead of full path (#201660)

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.

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
This commit is contained in:
Adi1231234 2026-03-24 15:02:46 +02:00 • committed by GitHub
commit 51f5920153
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -139,7 +139,7 @@ class RemoteAuth extends BaseAuthStrategy {
try {
compressedSessionPath = await this.compressSession();
await this.store.save({
session: path.join(this.dataPath, this.sessionName),
session: this.sessionName,
});
if (options && options.emit)
this.client.emit(Events.REMOTE_SESSION_SAVED);