fix(algebra-8 ch1): прогресс пишется под правильный slug + миграция 016

После переименования slug algebra-8 → algebra-8-ch1 (миграция 014) Глава 1
продолжала POSTить прогресс под старым именем 'algebra-8', который теперь
указывает на hub-строку. Эффект: paragraphs_read и last_para уходили в
hub-row, а каталог хабов их игнорировал (агрегирует только children).

Фикс:
- algebra_8.html: _TB_SLUG = 'algebra-8-ch1'
- migration 016: union перенос ошибочно записанного прогресса из hub в
  ch1; очистка hub-row. Идемпотентно (NOT EXISTS guard).

Проверено: после миграции у user 2 paragraphs_read='["p1"]' живёт в
ch1-row, hub-row пуста.

Другие учебники проверены — корректно:
- ch2/ch3 уже использовали правильные slug
- chemistry-9, physics-9, physics8_* подключены через textbook-tracker
- algebra_8_hub.html и physics_8.html — хабы без tracker (правильно)
This commit is contained in:
Maxim Dolgolyov
2026-05-27 17:03:59 +03:00
parent 1a347650f4
commit dad34dc1d6
2 changed files with 60 additions and 1 deletions
+1 -1
View File
@@ -1073,7 +1073,7 @@ function bumpProgress(key, delta){
}
/* Server sync of read/last_para — пишем в БД, чтобы каталог /textbooks показывал прогресс */
const _TB_SLUG = 'algebra-8';
const _TB_SLUG = 'algebra-8-ch1';
const _markedRead = new Set();
let _pendingProgressBody = null, _progressTimer = null;
function _flushProgress(){