fix(teacher): register migration, containment period queries, concurrency guards

- Register AppDatabase.MIGRATION_3_4 so v3 databases upgrade without data loss
- Query teacher schedule periods by containment (weekStart<=x AND weekEnd>=x)
  instead of exact weekStart, matching 2-week catalog windows
- Clip buildTeacherSchedule days to the requested week range
- Add weeksFor() to enumerate weeks of a catalog window for the UI selector
- Serialize syncPeriod body with a Mutex to protect the unique index
- Rethrow CancellationException before generic catch; version loadRevision
  checks so stale observers/loads are cancelled
- Sync job tracking in PickerViewModel; keep loading true while empty
- Drop dead selectTeacher helper
This commit is contained in:
2026-09-19 23:32:09 +03:00
parent 39e4f5a04f
commit 1d55e84e96
7 changed files with 205 additions and 103 deletions
@@ -23,6 +23,7 @@ class AppContainer(context: Context) {
AppDatabase::class.java,
"vyatsu_schedule.db"
)
.addMigrations(AppDatabase.MIGRATION_3_4)
.fallbackToDestructiveMigration(dropAllTables = true)
.build()