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:
- Create a new Baileys socket with
markOnlineOnConnect: false
- Pair the WhatsApp account using QR or pairing code
- Wait until the socket emits
connection: "open"
- From another WhatsApp account, open a chat with the paired account
- Observe that the paired account appears online
- Send a message to the paired account
- 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):
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,
})
Describe the bug
After pairing a Baileys session, the WhatsApp account appears as online from another WhatsApp account, even though
markOnlineOnConnectis set tofalse.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
composingorpaused. The account-level online status appears immediately after the socket reachesopen.To Reproduce
Steps to reproduce the behavior:
markOnlineOnConnect: falseconnection: "open"Expected behavior
When
markOnlineOnConnect: falseis 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
connectOptionslook like?