mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Removed deprecations + merge message-status-update into chat-update
1. Update package version to 4.0.0 2. Retry query if the connection unexpectedly closes + make query iterative instead of recursive 3. Remove message-new & message-update deprecations 4. Deprecate loadProfilePicturesForChatsAutomatically
This commit is contained in:
@@ -372,4 +372,21 @@ describe ('Pending Requests', () => {
|
||||
|
||||
conn.close ()
|
||||
})
|
||||
it('should re-execute query on connection closed error', async () => {
|
||||
const conn = makeConnection ()
|
||||
//conn.pendingRequestTimeoutMs = 10_000
|
||||
await conn.loadAuthInfo('./auth_info.json').connect ()
|
||||
const task: Promise<any> = conn.query({json: ['query', 'Status', conn.user.jid], waitForOpen: true})
|
||||
|
||||
await delay(20)
|
||||
conn['onMessageRecieved']('1234,["Pong",false]') // fake cancel the connection
|
||||
|
||||
await delay(2000)
|
||||
|
||||
const json = await task
|
||||
|
||||
assert.ok (json.status)
|
||||
|
||||
conn.close ()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user