Skip to content

Commit

Permalink
fix(packages/graphql): ensure that repetition interval remains below …
Browse files Browse the repository at this point in the history
…maximum value (#4348)
  • Loading branch information
sjschlapbach authored Nov 3, 2024
1 parent 63708f5 commit 30f4953
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/graphql/src/services/practiceQuizzes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ function updateSpacedRepetition({
} else if (streak === 2) {
newInterval = 6
} else {
newInterval = Math.ceil(interval * newEfactor)
// limit maximum interval to 10'000 days to ensure that dates remain valid
newInterval = Math.min(Math.ceil(interval * newEfactor), 10000)
}
}

Expand Down

0 comments on commit 30f4953

Please sign in to comment.