server: try to fix queue errors

Some errors in the queue are not properly handled. For example a blocked instance
will cause the respective queue job to be retried. this should of course not happen
and instead the job should be dropped. This is trying to correct that.

Changelog: Fixed
This commit is contained in:
Johann150 2023-09-24 16:29:27 +02:00
parent 0cb4529ed0
commit 37658f5162
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -41,13 +41,15 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
return `skip: unsupported LD-signature type ${activity.signature.type}`;
}
// get user based on LD-Signature key id.
// lets assume that the creator has this common form:
// <https://example.com/users/user#main-key>
// Then we can use it as the key id and (without fragment part) user id.
authUser = await getAuthUser(activity.signature.creator, activity.signature.creator.replace(/#.*$/, ''), resolver);
try {
// get user based on LD-Signature key id.
// lets assume that the creator has this common form:
// <https://example.com/users/user#main-key>
// Then we can use it as the key id and (without fragment part) user id.
authUser = await getAuthUser(activity.signature.creator, activity.signature.creator.replace(/#.*$/, ''), resolver);
if (authUser == null) {
if (authUser == null) throw new Error();
} catch {
return 'skip: failed to resolve LD-Signature user';
}