From fd36e89721fef44f6784fb7ea0766ce803998c24 Mon Sep 17 00:00:00 2001 From: "Tom Liu (Liu Hsiu-Chi)" <0xtomlord1122@gmail.com> Date: Tue, 15 Sep 2026 23:25:56 +0800 Subject: [PATCH] fix(cir): cap review interval at 365 days Signed-off-by: Tom Liu (Liu Hsiu-Chi) <0xtomlord1122@gmail.com> --- src/main/lib/cir.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/lib/cir.ts b/src/main/lib/cir.ts index cce12ac..ef965a7 100644 --- a/src/main/lib/cir.ts +++ b/src/main/lib/cir.ts @@ -43,6 +43,7 @@ const SUCCESS_RATE_PENALTY = 0.8 const INTERVIEW_MODE_MULTIPLIER = 0.5 const EASY_BONUS_MULTIPLIER = 1.15 const MIN_EASE_FACTOR = 1.3 +const MAX_INTERVAL_DAYS = 365 // Initial ease factor for new cards export const INITIAL_EASE_FACTOR = 2.5 @@ -135,8 +136,7 @@ export function calculateNextReview( newInterval = Math.max(1, Math.round(newInterval * INTERVIEW_MODE_MULTIPLIER)) } - // Ensure minimum interval of 1 day - newInterval = Math.max(1, newInterval) + newInterval = Math.max(1, Math.min(MAX_INTERVAL_DAYS, newInterval)) return { newState: {