Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: fix note history cleanup tests

Abdullah Atta2bd74e043a7b
diff --git a/packages/core/src/collections/note-history.ts b/packages/core/src/collections/note-history.ts
index bcbd8b8ba..f56da3afb 100644
--- a/packages/core/src/collections/note-history.ts
+++ b/packages/core/src/collections/note-history.ts
@@ -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()