[backend] Create a new resolver in parseAudience if none is passed to the function

This commit addresses disclosed primitive 23
This commit is contained in:
Laura Hausmann 2024-10-29 12:27:25 +01:00
parent dc3c2d1ad4
commit ca331d2406
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605

View File

@ -1,6 +1,6 @@
import type { ApObject } from "./type.js";
import { getApIds } from "./type.js";
import type Resolver from "./resolver.js";
import Resolver from "./resolver.js";
import { resolvePerson } from "./models/person.js";
import { unique, concat } from "@/prelude/array.js";
import promiseLimit from "promise-limit";
@ -31,6 +31,7 @@ export async function parseAudience(
const others = unique(concat([toGroups.other, ccGroups.other]));
resolver ??= new Resolver();
const limit = promiseLimit<CacheableUser | null>(2);
const mentionedUsers = (
await Promise.all(