Skip to content

markOnlineOnConnect: false does not prevent account from appearing online / phone push notifications stop after pairing #2553

@OrhanAykac

Description

@OrhanAykac

Describe the bug

After pairing a Baileys session, the WhatsApp account appears as online from another WhatsApp account, even though markOnlineOnConnect is set to false.

Because the linked Baileys session appears active, the primary phone / other devices stop receiving push notifications for incoming messages.

This does not seem to be caused by chatstate presence such as composing or paused. The account-level online status appears immediately after the socket reaches open.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new Baileys socket with markOnlineOnConnect: false
  2. Pair the WhatsApp account using QR or pairing code
  3. Wait until the socket emits connection: "open"
  4. From another WhatsApp account, open a chat with the paired account
  5. Observe that the paired account appears online
  6. Send a message to the paired account
  7. The primary phone / other devices do not receive push notifications

Expected behavior

When markOnlineOnConnect: false is used, the linked Baileys session should not make the WhatsApp account appear online to other users.

The primary phone / other devices should continue receiving push notifications for incoming messages.

Environment (please complete the following information):

  • Is this on a server?
    Yes

  • What do your connectOptions look like?

const sock = makeWASocket({
  version,
  auth: {
    creds: state.creds,
    keys: makeCacheableSignalKeyStore(state.keys, logger),
  },
  printQRInTerminal: false,
  logger,
  browser: Browsers.windows('Chrome'),
  keepAliveIntervalMs: 30_000,
  generateHighQualityLinkPreview: false,
  markOnlineOnConnect: false,
  syncFullHistory: false,
  fireInitQueries: false,
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions