fix: lesson progress, unit unlock, daily goal, localStorage #6

Merged
adminoo merged 1 commit from fix/progress-persistence into main 2026-08-15 18:09:14 +00:00
Owner

4 bugs fixed:

  1. lessonsForUnitProvider invalidation
  2. Unit unlock on completion
  3. getDailyCompletedCount web crash
  4. localStorage persistence

85 tests passing, 0 analyze issues, deployed.

4 bugs fixed: 1. lessonsForUnitProvider invalidation 2. Unit unlock on completion 3. getDailyCompletedCount web crash 4. localStorage persistence 85 tests passing, 0 analyze issues, deployed.
fix: lesson progress persistence, unit unlock, daily goal, localStorage
All checks were successful
CI / validate (pull_request) Successful in 4m18s
cdc39ccbaf
Bug 1: lessonsForUnitProvider not invalidated after completion
- Added ref.invalidate(lessonsForUnitProvider) in _completeLesson

Bug 2: No unit unlock logic
- Added getUnit() method to both DB implementations
- applyLessonReward now checks if unit is complete and unlocks next

Bug 3: getDailyCompletedCount crashes on web (_db.database throws)
- Added getCompletedLessonsToday() to AppDatabase interface
- Replaced direct database.query() with platform-safe method

Bug 4: In-memory storage loses data on page refresh
- Added localStorage persistence via shared_preferences
- Every write operation calls _persist() after mutation
- init() restores from localStorage if available

Tests: 85 passing (was 75, +10 new: web DB, unit unlock, persistence)
dart analyze: 0 issues
Deployed to https://app.135.106.182.66.nip.io/
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
adminoo/sysroadmap!6
No description provided.