From 27b1846429c3d92a18092d7f5bcf4e03cde69a5e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 14:08:06 +0000 Subject: [PATCH] Add test to verify normal instance blocking still works Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- .../queue/processors/InboxProcessorService.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/backend/test/unit/queue/processors/InboxProcessorService.ts b/packages/backend/test/unit/queue/processors/InboxProcessorService.ts index fc4fea520c..1f0b6ccc59 100644 --- a/packages/backend/test/unit/queue/processors/InboxProcessorService.ts +++ b/packages/backend/test/unit/queue/processors/InboxProcessorService.ts @@ -201,5 +201,32 @@ describe('InboxProcessorService', () => { } ); }); + + test('should still block direct requests from blocked instances', async () => { + const jobData = { + signature: { + keyId: 'https://blocked.example.com/actor#main-key', // Direct from blocked instance + }, + activity: { + type: 'Create', + actor: 'https://blocked.example.com/users/testuser', + id: 'https://blocked.example.com/activities/1', + object: { + type: 'Note', + id: 'https://blocked.example.com/notes/1', + content: 'test note', + attributedTo: 'https://blocked.example.com/users/testuser', + }, + }, + }; + + const job = { + data: jobData, + } as Bull.Job; + + // Should be blocked at the primary federation check (before user resolution) + const result = await inboxProcessorService.process(job); + assert.strictEqual(result, 'Blocked request: blocked.example.com'); + }); }); }); \ No newline at end of file