WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.17k stars 1.1k forks source link

[BUG] Closing open session in favor of incoming prekey bundle / Closing session: SessionEntry #887

Closed oscarguindzberg closed 3 weeks ago

oscarguindzberg commented 3 weeks ago

Describe the bug I have a server with 15 connected whatsapp users. I find this on the log from time to time:

Closing open session in favor of incoming prekey bundle
Closing session: SessionEntry {
  _chains: {
    'xxx': { chainKey: [Object], chainType: 2, messageKeys: {} },
    'xxx': { chainKey: [Object], chainType: 1, messageKeys: {} }
  },
  registrationId: 2031812068,
  currentRatchet: {
    ephemeralKeyPair: {
      pubKey: <Buffer xx xx xx ...>,
      privKey: <Buffer xx xx xx ...>
    },
    lastRemoteEphemeralKey: <Buffer xx xx xx ...>,
    previousCounter: 0,
    rootKey: <Buffer xx xx xx ...>
  },
  indexInfo: {
    baseKey: <Buffer xx xx xx ...>,
    baseKeyType: 2,
    closed: -1,
    used: 1718654391536,
    created: 1718654391536,
    remoteIdentityKey: <Buffer xx xx xx ...>
  }
}

I know this is printed by libsignal, I guess these lines are the culprits:

To Reproduce Steps to reproduce the behavior: Don't know how to reproduce, it happens from time to time on a server with 15 connected whatsapp users.

Expected behavior No errors on the log

Environment (please complete the following information):

Additional context Using baileys v6.7.5

oscarguindzberg commented 3 weeks ago

These bugs may be related https://github.com/WhiskeySockets/Baileys/issues/885 https://github.com/WhiskeySockets/Baileys/issues/886 https://github.com/WhiskeySockets/Baileys/issues/887 https://github.com/WhiskeySockets/Baileys/issues/888

oscarguindzberg commented 3 weeks ago

I don't understand why was the issue closed.