fix(stats): preserve session rollups across schema upgrades

- Stop deleting imm_daily_rollups/imm_monthly_rollups on unrelated schema version bumps; their source session/telemetry rows may already be pruned, so deleted buckets could not be rebuilt
- Run startup session-rollup maintenance before the lexical rollup backfill takes the write lock, so recovery no longer races playback writes
- Update the vocabulary summary totals changelog fragment to reflect that watch-time, activity, efficiency, and library charts are no longer cleared during rebuilds
This commit is contained in:
2026-08-18 01:12:58 -07:00
parent e9778a945a
commit db61ce358d
5 changed files with 126 additions and 9 deletions
@@ -591,8 +591,8 @@ export class ImmersionTrackerService {
}
}
this.preparedStatements = createTrackerPreparedStatements(this.db);
if (!areLexicalDailyRollupsReady(this.db)) this.startLexicalRollupBackfill();
this.scheduleMaintenance();
if (!areLexicalDailyRollupsReady(this.db)) this.startLexicalRollupBackfill();
this.scheduleFlush();
}