handleBlocked: Continue on if we receive non-ACI
This commit is contained in:
parent
85a7fc64bc
commit
7548e2adc2
2 changed files with 17 additions and 4 deletions
|
@ -3881,9 +3881,19 @@ export default class MessageReceiver
|
||||||
}
|
}
|
||||||
if (blocked.acis) {
|
if (blocked.acis) {
|
||||||
const previous = this.storage.get('blocked-uuids', []);
|
const previous = this.storage.get('blocked-uuids', []);
|
||||||
const acis = blocked.acis.map((aci, index) => {
|
const acis = blocked.acis
|
||||||
return normalizeAci(aci, `handleBlocked.acis.${index}`);
|
.map((aci, index) => {
|
||||||
});
|
try {
|
||||||
|
return normalizeAci(aci, `handleBlocked.acis.${index}`);
|
||||||
|
} catch (error) {
|
||||||
|
log.warn(
|
||||||
|
`${logId}: ACI ${aci} was malformed`,
|
||||||
|
Errors.toLogFormat(error)
|
||||||
|
);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.filter(isNotNil);
|
||||||
|
|
||||||
const { added, removed } = diffArraysAsSets(previous, acis);
|
const { added, removed } = diffArraysAsSets(previous, acis);
|
||||||
if (added.length) {
|
if (added.length) {
|
||||||
|
|
|
@ -29,7 +29,10 @@ export function normalizeAci(
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = rawAci.toLowerCase();
|
const result = rawAci.toLowerCase();
|
||||||
strictAssert(!result.startsWith('pni:'), 'ACI should not start with PNI:');
|
strictAssert(
|
||||||
|
!result.startsWith('pni:'),
|
||||||
|
`ACI should not start with 'PNI:' in ${context}`
|
||||||
|
);
|
||||||
|
|
||||||
if (!isAciString(result)) {
|
if (!isAciString(result)) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue