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 team-friendo/signalboost!387
parents c0f8d3fe de2bb2f4
...@@ -108,10 +108,10 @@ const broadcast = async ({ channel, sdMessage }) => { ...@@ -108,10 +108,10 @@ const broadcast = async ({ channel, sdMessage }) => {
try { try {
if (isEmpty(sdMessage.attachments)) { if (isEmpty(sdMessage.attachments)) {
await Promise.all( await sequence(
recipients.map(recipient => recipients.map(recipient => () =>
signal.broadcastMessage( signal.sendMessage(
[recipient.memberPhoneNumber], recipient.memberPhoneNumber,
addHeader({ addHeader({
channel, channel,
sdMessage, sdMessage,
......
...@@ -93,7 +93,8 @@ describe('dispatcher service', () => { ...@@ -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', () => { 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