fix(stats): harden vocabulary rollups

This commit is contained in:
2026-08-16 00:21:49 -07:00
parent 65911474cf
commit d220055b99
12 changed files with 311 additions and 44 deletions
@@ -153,7 +153,13 @@ export function rebuildLexicalDailyRollups(db: DatabaseSync): void {
markLexicalDailyRollupsReady(db);
db.exec('COMMIT');
} catch (error) {
if (transactionStarted) db.exec('ROLLBACK');
if (transactionStarted) {
try {
db.exec('ROLLBACK');
} catch {
// Preserve the rebuild failure; it is the actionable cause.
}
}
throw error;
}
}