Commit 6090a036 authored by aguestuser's avatar aguestuser

Merge branch 'hotfix-actually-send-broadcasts-in-sequence' into 'main'

[hotfix] actually send broadcast messages in sequence

See merge request !387
parents c0f8d3fe de2bb2f4
......@@ -108,10 +108,10 @@ const broadcast = async ({ channel, sdMessage }) => {
try {
if (isEmpty(sdMessage.attachments)) {
await Promise.all(
recipients.map(recipient =>
signal.broadcastMessage(
[recipient.memberPhoneNumber],
await sequence(
recipients.map(recipient => () =>
signal.sendMessage(
recipient.memberPhoneNumber,
addHeader({
channel,
sdMessage,
......
......@@ -93,7 +93,8 @@ describe('dispatcher service', () => {
},
}),
)
await wait(socketDelay)
// wait longer b/c we send broadcast messages in sequence
await wait(4 * socketDelay)
})
it('relays the message to all admins and subscribers', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment