general: revert #1665

This commit is contained in:
Rajeh Taher
2025-10-03 18:14:30 +03:00
parent 55f09e8c84
commit 334977f983
29 changed files with 51841 additions and 3500 deletions
@@ -1,5 +1,5 @@
import { jest } from '@jest/globals'
import { proto } from '../..'
import { proto, type WAMessage } from '../..'
import { DEFAULT_CONNECTION_CONFIG } from '../../Defaults'
import makeWASocket from '../../Socket'
import { makeSession, mockWebSocket } from '../TestUtils/session'
@@ -26,11 +26,11 @@ describe('Connection Deadlock Test', () => {
// 2. Now, emit a regular message. Because the previous step should have
// flushed the buffer, this message should be processed immediately.
const regularMessage = proto.WebMessageInfo.create({
const regularMessage = proto.WebMessageInfo.fromObject({
key: { remoteJid: '1234567890@s.whatsapp.net', fromMe: false, id: 'REGULAR_MSG_1' },
messageTimestamp: Date.now() / 1000,
message: { conversation: 'Hello, world!' }
})
}) as WAMessage
sock.ev.emit('messages.upsert', { messages: [regularMessage], type: 'notify' })
// Wait for the event loop to process any final events.
await new Promise(resolve => setTimeout(resolve, 50))