Skip to content

fix: use active login for existing sessions#2682

Open
gobeyondpty wants to merge 1 commit into
WhiskeySockets:masterfrom
gobeyondpty:fix/login-node-active-mode
Open

fix: use active login for existing sessions#2682
gobeyondpty wants to merge 1 commit into
WhiskeySockets:masterfrom
gobeyondpty:fix/login-node-active-mode

Conversation

@gobeyondpty

@gobeyondpty gobeyondpty commented Jul 2, 2026

Copy link
Copy Markdown

Summary

  • set generateLoginNode to send passive: false
  • document why passive login is unsafe for existing companion sessions

Why

Real reconnect/import testing has shown WhatsApp can terminate login-node flows with 428 when the existing companion session is sent as passive. Registration already uses passive: false; login should use the same active mode for an existing session.

Checks

  • git diff --check

I could not run the full project build in this clean worktree because dependencies are not installed and yarn is not available on the host.


Summary by cubic

Use active login for existing companion sessions by setting passive: false in the login payload. Prevents 428 rejections during reconnect/import and aligns login with registration behavior.

Written for commit 680f61a. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Updated login behavior so sign-in requests are sent in a more compatible mode, reducing the chance of rejection during authentication.

@whiskeysockets-bot

Copy link
Copy Markdown
Contributor

Thanks for opening this pull request and contributing to the project!

The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch.

In the meantime, anyone in the community is encouraged to test this pull request and provide feedback.

✅ How to confirm it works

If you’ve tested this PR, please comment below with:

Tested and working ✅

This helps us speed up the review and merge process.

📦 To test this PR locally:

# NPM
npm install @whiskeysockets/baileys@gobeyondpty/Baileys#fix/login-node-active-mode

# Yarn (v2+)
yarn add @whiskeysockets/baileys@gobeyondpty/Baileys#fix/login-node-active-mode

# PNPM
pnpm add @whiskeysockets/baileys@gobeyondpty/Baileys#fix/login-node-active-mode

If you encounter any issues or have feedback, feel free to comment as well.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a6d12ff6-56e9-4efb-8ed1-620b57479320

📥 Commits

Reviewing files that changed from the base of the PR and between 731cd6b and 680f61a.

📒 Files selected for processing (1)
  • src/Utils/validate-connection.ts

📝 Walkthrough

Walkthrough

The generateLoginNode function in validate-connection.ts was modified to set the passive field of the client payload to false instead of true, accompanied by an explanatory comment.

Changes

Login Payload Flag Update

Layer / File(s) Summary
Change passive flag in login payload
src/Utils/validate-connection.ts
The passive flag in the constructed client payload is changed from true to false, with a new comment noting passive logins may be rejected (428).

Estimated code review effort: 1 (Trivial) | ~3 minutes

Poem

A single flag flipped, small and neat,
No more passive, login's complete,
A comment added to explain the why,
This bunny hops on, code review nigh! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: switching existing-session login flows to active mode.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants