mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-24 04:53:33 +00:00
fix: Remote Note Cleaning will delete notes embedded in a page (#16408)
* feat: preserve number of pages referencing the note * chore: delete pages on account delete * fix: notes on the pages are removed by CleanRemoteNotes * test: add the simplest test for page embedded notes * fix: section block is not considered * fix: section block is not considered in migration * chore: remove comments from columns * revert unnecessary change * add pageCount to webhook test * fix type error on backend
This commit is contained in:
@@ -281,6 +281,24 @@ describe('CleanRemoteNotesProcessorService', () => {
|
||||
expect(remainingNote).not.toBeNull();
|
||||
});
|
||||
|
||||
// ページ
|
||||
test('should not delete note that is embedded in a page', async () => {
|
||||
const job = createMockJob();
|
||||
|
||||
// Create old remote note that is embedded in a page
|
||||
const clippedNote = await createNote({
|
||||
pageCount: 1, // Embedded in a page
|
||||
}, bob, Date.now() - ms(`${meta.remoteNotesCleaningExpiryDaysForEachNotes} days`) - 1000);
|
||||
|
||||
const result = await service.process(job as any);
|
||||
|
||||
expect(result.deletedCount).toBe(0);
|
||||
expect(result.skipped).toBe(false);
|
||||
|
||||
const remainingNote = await notesRepository.findOneBy({ id: clippedNote.id });
|
||||
expect(remainingNote).not.toBeNull();
|
||||
});
|
||||
|
||||
// 古いreply, renoteが含まれている時の挙動
|
||||
test('should handle reply/renote relationships correctly', async () => {
|
||||
const job = createMockJob();
|
||||
|
||||
Reference in New Issue
Block a user