Study: lesson reminders on by default for new accounts; one-time backfill turns them on for existing accounts; v2.46.0
Publish Container / build (push) Successful in 16m7s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-19 16:53:03 -04:00
1 parent a11adf8ad2
commit 30a7e8a6cb
5 files changed
+27 -2

No files matched your search

+17
View File
@@ -736,6 +736,23 @@ export function extractResendMessageId(result) {
return ''
}
// One-off pass: lesson reminders are now on by default, so switch them on for accounts that
// predate the default. Each account is marked as it is handled, so a later opt-out sticks.
export async function backfillReminderDefault() {
const now = new Date().toISOString()
let updated = 0
for (const user of state.studyUsers) {
if (user.remindersDefaultedAt) continue
if (user.studyRemindersEnabled !== true) {
user.studyRemindersEnabled = true
updated++
}
user.remindersDefaultedAt = now
}
if (state.studyUsers.some(user => user.remindersDefaultedAt === now)) queueStudyUsersWrite()
return updated
}
// ── Study reminder scheduler ───────────────────────────────────────────────
export async function scheduleStudyReminders(sendStudyReminderEmail) {