diff --git a/integration_test/channel/kickban.js b/integration_test/channel/kickban.js index b60d14ba..f153bb93 100644 --- a/integration_test/channel/kickban.js +++ b/integration_test/channel/kickban.js @@ -362,7 +362,6 @@ describe('KickbanModule', () => { ); }); - // TODO: for whatever reason, this test is flaky it('inserts a valid IPv6 ban', done => { const longIP = require('../../lib/utilities').expandIPv6('::abcd'); diff --git a/src/channel/kickban.js b/src/channel/kickban.js index 9c342bf3..e5001d5f 100644 --- a/src/channel/kickban.js +++ b/src/channel/kickban.js @@ -404,7 +404,12 @@ KickBanModule.prototype.banAll = async function banAll( ); if (!await dbIsNameBanned(chan.name, name)) { - promises.push(this.banName(actor, name, reason)); + promises.push(this.banName(actor, name, reason).catch(error => { + // TODO: banning should be made idempotent, not throw an error + if (!/already banned/.test(error.message)) { + throw error; + } + })); } await Promise.all(promises);