Skip to content

Commit 88c1830

Browse files
committed
fix: timeout error on send status message
1 parent 23549e3 commit 88c1830

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Fix buildkey function in hSet and hDelete
1717
* Fix mexico number
1818
* Update baileys version
19+
* Update in Baileys version that fixes timeout when updating profile picture
20+
* Adjusts for fix timeout error on send status message
1921

2022
# 2.1.1 (2024-09-22 10:31)
2123

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,9 +1741,25 @@ export class BaileysStartupService extends ChannelStartupService {
17411741
}
17421742

17431743
if (sender === 'status@broadcast') {
1744-
const jidList = message['status'].option.statusJidList;
1744+
let jidList;
1745+
if (message['status'].option.allContacts) {
1746+
const contacts = await this.prismaRepository.contact.findMany({
1747+
where: {
1748+
instanceId: this.instanceId,
1749+
remoteJid: {
1750+
not: {
1751+
endsWith: '@g.us',
1752+
},
1753+
},
1754+
},
1755+
});
1756+
1757+
jidList = contacts.map((contact) => contact.remoteJid);
1758+
} else {
1759+
jidList = message['status'].option.statusJidList;
1760+
}
17451761

1746-
const batchSize = 500;
1762+
const batchSize = 10;
17471763

17481764
const batches = Array.from({ length: Math.ceil(jidList.length / batchSize) }, (_, i) =>
17491765
jidList.slice(i * batchSize, i * batchSize + batchSize),

0 commit comments

Comments
 (0)