aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/db/repositories.test.ts
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-02-02 12:22:03 +0000
committerClaude <noreply@anthropic.com>2026-02-02 12:22:03 +0000
commitd4489f24a05911d1395e8473fe86c3442d9397ee (patch)
tree3f302c9c531c7ba25e2c5ad74c44b086df03a0d7 /src/client/db/repositories.test.ts
parentc20922a1aa339e34b4bed3747222f4b9d9941cd6 (diff)
downloadkioku-d4489f24a05911d1395e8473fe86c3442d9397ee.tar.gz
kioku-d4489f24a05911d1395e8473fe86c3442d9397ee.tar.zst
kioku-d4489f24a05911d1395e8473fe86c3442d9397ee.zip
fix(study): use date-based comparison with 3 AM boundary for due cards
Instead of comparing due timestamps exactly (card.due <= now), compare against the next 3 AM boundary so all cards due within the current study day appear at once. This prevents new cards from trickling in throughout the day when FSRS fuzz spreads due times. https://claude.ai/code/session_01FeDztLcyGofd6nxh8ct7a3
Diffstat (limited to 'src/client/db/repositories.test.ts')
-rw-r--r--src/client/db/repositories.test.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/db/repositories.test.ts b/src/client/db/repositories.test.ts
index 448cb9e..38cf3fb 100644
--- a/src/client/db/repositories.test.ts
+++ b/src/client/db/repositories.test.ts
@@ -299,7 +299,8 @@ describe("localCardRepository", () => {
describe("findDueCards", () => {
it("should return cards that are due", async () => {
const pastDue = new Date(Date.now() - 60000);
- const future = new Date(Date.now() + 60000);
+ // Use a date far enough in the future to be beyond the next 3 AM boundary
+ const future = new Date(Date.now() + 2 * 24 * 60 * 60 * 1000);
const card1 = await localCardRepository.create({
deckId,