-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Card Scheduling System Issues
Title: Fix: Card scheduling system has multiple critical issues causing repetitive cards and buried reviews
Labels: bug, high-priority, scheduling, spaced-repetition
Body:
Card Scheduling System Issues
Problem Summary
The spaced repetition system exhibits "wonky" behavior where cards are repeatedly shown during sessions while others are effectively buried. Analysis of production logs reveals multiple interconnected issues.
Root Causes Identified
🔴 Critical Issues
- seenCardIds mechanism broken - Each queue (new/review/failed) has separate
seenCardIdsarrays, allowing same cards to appear multiple times as they move between queues - Race conditions in card scheduling - Async operations in
scheduleReview()not properly synchronized, causing cards to be scheduled before old reviews are removed - K-value implementation missing - Calculated k-values are ignored in ELO updates, preventing proper difficulty adaptation
🟡 High Priority Issues
- Timestamp format bug - Uses
kk(1-24) instead ofHH(00-23) for UTC timestamps, causing parsing inconsistencies - Router error preventing session cleanup -
this.router is undefinedprevents proper session termination, corrupting state - Fire-and-forget database operations - DB operations use
voidwithout error handling, causing silent failures
🟠 Medium Priority
- ELO-scheduling disconnection - ELO scores don't influence spaced repetition intervals
Affected Components
packages/common-ui/src/components/StudySession.vuepackages/db/src/study/SessionController.tspackages/db/src/impl/common/userDBHelpers.tspackages/platform-ui/src/views/Study.vuepackages/common/src/elo.ts
Proposed Solution Priority
Phase 1: Critical Fixes
- Centralize seenCardIds mechanism across all queues
- Synchronize async operations in scheduleReview()
- Fix router error with proper Vue 3 routing
Phase 2: High Priority
- Correct timestamp format (requires migration)
- Add proper error handling to DB operations
- Implement k-value interpretation
Phase 3: Optimization
- Integrate ELO scores with spaced repetition intervals
Testing Requirements
- Unit tests for individual components
- Integration tests for async operation sequences
- E2E tests for complete study session flows
- Performance tests for database operations
Migration Notes
- Timestamp fix requires careful migration of existing scheduled cards
- K-value implementation applies to future interactions only
- Router fix requires updating Vue component patterns
This issue affects core learning functionality and should be prioritized for the next release.
Technical Details
Detailed analysis available in agent/a.2.complete-analysis.md with specific code locations, examples, and recommended fixes for each issue.
Evidence
Production logs show pattern of repeated card IDs within sessions and timestamp-related scheduling inconsistencies. Router errors occur consistently at session termination.