This commit is contained in:
2026-07-20 06:38:33 +08:00
parent 36124cc4a1
commit 1290219077
2 changed files with 17 additions and 4 deletions
+3 -1
View File
@@ -444,7 +444,9 @@ exports.upsertLessonPage = async (req, res) => {
}, { returning: true });
try {
await recomputeDurations(lessonId);
// Pass the blocks we just wrote directly instead of re-reading the page —
// avoids depending on read-after-write visibility of the upsert we just did.
await recomputeDurations(lessonId, blocks);
} catch (durErr) {
console.error("[LESSON LIB][PAGE][DURATION]", durErr);
}