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()