fix(vocab): restore due daily reviews after empty session
All checks were successful
Deploy to production / deploy (push) Successful in 2m6s
All checks were successful
Deploy to production / deploy (push) Successful in 2m6s
This commit is contained in:
@@ -143,7 +143,9 @@ const PRACTICE_MIN_EXPOSURES = 3;
|
|||||||
// The original daily batch remains stable when the dialog is reopened.
|
// The original daily batch remains stable when the dialog is reopened.
|
||||||
// Keep in sync with VocabCourseView. v3 discards legacy empty sessions that
|
// Keep in sync with VocabCourseView. v3 discards legacy empty sessions that
|
||||||
// could block cards due later on the same calendar day.
|
// could block cards due later on the same calendar day.
|
||||||
const SRS_SESSION_STORAGE_VERSION = 3;
|
// Keep this in sync with VocabCourseView. Version 4 discards stale empty
|
||||||
|
// sessions that could mask a new daily SRS batch.
|
||||||
|
const SRS_SESSION_STORAGE_VERSION = 4;
|
||||||
const HARD_REQUIRED_CONSECUTIVE_CORRECT = 5;
|
const HARD_REQUIRED_CONSECUTIVE_CORRECT = 5;
|
||||||
const MAX_DAILY_DUE = 50;
|
const MAX_DAILY_DUE = 50;
|
||||||
const MAX_DAILY_HARD_VOCABS = 7;
|
const MAX_DAILY_HARD_VOCABS = 7;
|
||||||
|
|||||||
@@ -377,7 +377,9 @@ import { localizeVocabCourseTitle } from '@/utils/vocabCourseTitle.js';
|
|||||||
|
|
||||||
// v3 invalidates old empty daily sessions. Those could be created before a
|
// v3 invalidates old empty daily sessions. Those could be created before a
|
||||||
// scheduled card became visible and then incorrectly hide today's due batch.
|
// scheduled card became visible and then incorrectly hide today's due batch.
|
||||||
const SRS_SESSION_STORAGE_VERSION = 3;
|
// Version 4 invalidates the old zero-card day sessions. Those sessions could
|
||||||
|
// hide a server-reported due backlog for the rest of a calendar day.
|
||||||
|
const SRS_SESSION_STORAGE_VERSION = 4;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VocabCourseView',
|
name: 'VocabCourseView',
|
||||||
@@ -602,11 +604,11 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const total = Math.max(0, Number(session.initialTotalDue) || 0);
|
const total = Math.max(0, Number(session.initialTotalDue) || 0);
|
||||||
// A session with no originally scheduled cards must not take
|
// A session with no originally scheduled cards must never take
|
||||||
// precedence over cards that are now due. This happened when the
|
// precedence over a server-reported due backlog. Check the server
|
||||||
// page was opened before the old time-of-day threshold and kept a
|
// total rather than just the loaded first page of cards: an empty or
|
||||||
// zero-card session for the rest of the calendar day.
|
// late item array must not turn e.g. "588 due" into "0 of 0 today".
|
||||||
if (total === 0 && this.srsDueItems.length > 0) {
|
if (total === 0 && this.srsDueCount > 0) {
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
this.srsTodayRemaining = null;
|
this.srsTodayRemaining = null;
|
||||||
this.srsTodayQuota = null;
|
this.srsTodayQuota = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user