mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chat updates bug fix
This commit is contained in:
@@ -239,10 +239,18 @@ describe ('Pending Requests', () => {
|
||||
|
||||
conn.close ()
|
||||
|
||||
const result0 = await conn.connect ()
|
||||
assert.deepEqual (result0.updatedChats, {})
|
||||
|
||||
conn.close ()
|
||||
|
||||
const oldChat = conn.chats.all()[0]
|
||||
oldChat.archive = 'true' // mark the first chat as archived
|
||||
oldChat.modify_tag = '1234' // change modify tag to detect change
|
||||
|
||||
// close the socket after a few seconds second to see if updates are correct after a reconnect
|
||||
setTimeout (() => conn['conn'].close(), 5000)
|
||||
|
||||
const result = await conn.connect ()
|
||||
assert.ok (!result.newConnection)
|
||||
|
||||
@@ -252,6 +260,8 @@ describe ('Pending Requests', () => {
|
||||
assert.ok ('archive' in chat)
|
||||
assert.equal (Object.keys(chat).length, 2)
|
||||
|
||||
assert.equal (Object.keys(result.updatedChats).length, 1)
|
||||
|
||||
conn.close ()
|
||||
})
|
||||
it('should queue requests when closed', async () => {
|
||||
|
||||
Reference in New Issue
Block a user