diff --git a/backend/services/vocabService.js b/backend/services/vocabService.js index 673f737..03efa3f 100755 --- a/backend/services/vocabService.js +++ b/backend/services/vocabService.js @@ -123,10 +123,13 @@ export default class VocabService { return crypto.createHash('sha1').update(raw).digest('hex'); } - _buildSrsPairFingerprint({ courseId, learning, reference, direction = 'BOTH' }) { + _buildSrsPairFingerprint({ courseId, learning, reference }) { + // The repetition plan is course-wide and trains both directions. Older + // rows were created with L2R/R2L while newly extracted course vocabulary + // uses BOTH. Direction must therefore not split one vocabulary pair into + // separate identities or make a valid old card disappear from the plan. return [ Number(courseId) || 0, - String(direction || 'BOTH').toUpperCase(), this._normalizeSrsText(learning), this._normalizeSrsText(reference) ].join('|');