The dashboard's corruption banner refresh action was a no-op for clearing stale corruption flags after the user repaired the DB. Database. scheduleBackgroundIntegrityCheck runs the integrity check exactly once at engine boot and then early-returns forever after, so corruptionDetected was sticky for the life of the process. POST /api/health/refresh just read the cached flag back. Add Database.refreshIntegrityCheck() and TaskStore.refreshDatabaseHealth() which synchronously re-run the integrity check and update the cached state, and have the route use them. After REINDEX / fn db --vacuum / any in-place repair, users can now clear the banner without restarting the engine. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
661 B
661 B
@runfusion/fusion
| @runfusion/fusion |
|---|
| patch |
Make the dashboard's "Refresh health" button actually re-run the SQLite integrity check. The background scheduler in Database.scheduleBackgroundIntegrityCheck only ran the check once at engine boot, so once corruptionDetected flipped to true it was sticky for the life of the process — the refresh action just re-read the same cached flag and the corruption banner could not be cleared even after the user repaired the DB (e.g. via REINDEX). POST /api/health/refresh now calls a new TaskStore.refreshDatabaseHealth which synchronously re-runs the integrity check and updates the cached state before responding.