core: fix note history cleanup tests

This commit is contained in:
Abdullah Atta
2025-10-03 09:05:52 +05:00
parent 1a05acbe9a
commit 2bd74e043a

View File

@@ -99,8 +99,8 @@ export class NoteHistory implements ICollection {
return sessionId;
}
private async cleanup(noteId: string) {
const limit = await this.db.options.maxNoteVersions();
private async cleanup(noteId: string, limit?: number) {
limit = limit || (await this.db.options.maxNoteVersions());
if (!limit) return;
const history = await this.db
.sql()