From fef9ebfe06113e211d21520faf65dc6e68ca0b56 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 6 Mar 2024 12:56:03 +0000 Subject: [PATCH] fix type error --- .../backend/src/queue/processors/InboxProcessorService.ts | 4 ++++ .../src/server/api/endpoints/admin/queue/inbox-delayed.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/queue/processors/InboxProcessorService.ts b/packages/backend/src/queue/processors/InboxProcessorService.ts index 23e377d790..e790267a04 100644 --- a/packages/backend/src/queue/processors/InboxProcessorService.ts +++ b/packages/backend/src/queue/processors/InboxProcessorService.ts @@ -53,6 +53,10 @@ export class InboxProcessorService { @bindThis public async process(job: Bull.Job): Promise { const signature = 'version' in job.data.signature ? job.data.signature.value : job.data.signature; + if (Array.isArray(signature)) { + // RFC 9401はsignatureが配列になるが、とりあえずエラーにする + throw new Error('signature is array'); + } const activity = job.data.activity; //#region Log diff --git a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 7839d8b6f5..42afa08485 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -57,7 +57,7 @@ export default class extends Endpoint { // eslint- for (const job of jobs) { const signature = 'version' in job.data.signature ? job.data.signature.value : job.data.signature; - const host = new URL(signature.keyId).host; + const host = Array.isArray(signature) ? 'TODO' : new URL(signature.keyId).host; if (res.find(x => x[0] === host)) { res.find(x => x[0] === host)![1]++; } else {