From f4aa986abdb4a18242737a973b6df9992b66688d Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 1 Jan 2025 16:33:01 +0000 Subject: [PATCH 1/2] fix scheduled replies becoming quote-boosts thanks to @CenTdemeern1 for triggering this bug! see https://kitsunes.club/notes/a2h1y2rq9n also compare with https://s.thenautilus.net/notes/a2h1y2rqx9 my instance errored out with: > WARN 1 [remote ap] Failed to resolve quote > https://mastodon.social/users/DrALJONES/statuses/110586222749407429 > for note https://kitsunes.club/notes/a2h1y2rq9n: StatusError: 404 Not > Found What happened? * Charlotte scheduled a reply * the processor called `findOneBy` with an undefined `note.renote`, which probably caused a `select` without any `where` * a random note was attached as a quote * that note has been deleted on the original instance but not on kitsuclub's database * the rest of fedi didn't notice the quote --- .../src/queue/processors/ScheduleNotePostProcessorService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/queue/processors/ScheduleNotePostProcessorService.ts b/packages/backend/src/queue/processors/ScheduleNotePostProcessorService.ts index 62e3d1072f..d823d98ef1 100644 --- a/packages/backend/src/queue/processors/ScheduleNotePostProcessorService.ts +++ b/packages/backend/src/queue/processors/ScheduleNotePostProcessorService.ts @@ -43,7 +43,7 @@ export class ScheduleNotePostProcessorService { @bindThis private async isValidNoteSchedule(note: MiScheduleNoteType, id: string): Promise { const reply = note.reply ? await this.notesRepository.findOneBy({ id: note.reply }) : undefined; - const renote = note.reply ? await this.notesRepository.findOneBy({ id: note.renote }) : undefined; + const renote = note.renote ? await this.notesRepository.findOneBy({ id: note.renote }) : undefined; const channel = note.channel ? await this.channelsRepository.findOneBy({ id: note.channel, isArchived: false }) : undefined; if (note.reply && !reply) { this.logger.warn('Schedule Note Failed Reason: parent note to reply does not exist'); @@ -78,7 +78,7 @@ export class ScheduleNotePostProcessorService { const me = await this.usersRepository.findOneBy({ id: data.userId }); const note = data.note; const reply = note.reply ? await this.notesRepository.findOneBy({ id: note.reply }) : undefined; - const renote = note.reply ? await this.notesRepository.findOneBy({ id: note.renote }) : undefined; + const renote = note.renote ? await this.notesRepository.findOneBy({ id: note.renote }) : undefined; const channel = note.channel ? await this.channelsRepository.findOneBy({ id: note.channel, isArchived: false }) : undefined; let files: MiDriveFile[] = []; From 5ef24836ef108733962940782cb34fe78f8eb92a Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 1 Jan 2025 17:11:38 +0000 Subject: [PATCH 2/2] bump version --- package.json | 2 +- packages/misskey-js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1d2544deeb..2119284b20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sharkey", - "version": "2024.11.1", + "version": "2024.11.2", "codename": "shonk", "repository": { "type": "git", diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 392f296bb0..f65d270a3d 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "misskey-js", - "version": "2024.11.1-rc", + "version": "2024.11.2", "description": "Misskey SDK for JavaScript", "license": "MIT", "main": "./built/index.js",