[backend] Catch errors in refetchPublicKeyForApId

This commit is contained in:
Laura Hausmann 2023-10-24 20:44:30 +02:00
parent 3b85491ee4
commit 9b13ec9c0c
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -206,6 +206,7 @@ export default class DbResolver {
} }
public async refetchPublicKeyForApId(user: CacheableRemoteUser): Promise<UserPublickey | null> { public async refetchPublicKeyForApId(user: CacheableRemoteUser): Promise<UserPublickey | null> {
try {
await updatePerson(user.uri!, undefined, undefined, user); await updatePerson(user.uri!, undefined, undefined, user);
let key = await UserPublickeys.findOneBy({ userId: user.id }); let key = await UserPublickeys.findOneBy({ userId: user.id });
if (key != null) { if (key != null) {
@ -213,6 +214,10 @@ export default class DbResolver {
} }
return key; return key;
} }
catch {
return null;
}
}
} }
subscriber.on("message", async (_, data) => { subscriber.on("message", async (_, data) => {