Fix progressive web UI slowdown from WAL bloat and missing index #133
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-132-wal-checkpoint-and-index"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #132
Changes
WAL checkpoint after periodic scan
Adds
PRAGMA wal_checkpoint(TRUNCATE)after each periodic scan cycle to prevent SQLite WAL file unbounded growth. The default PASSIVE auto-checkpoint silently fails when readers are active (which is always the case in a web server with HTMX polling). TRUNCATE waits for readers to finish and zeroes the WAL.Also adds
PRAGMA busy_timeout=5000at startup so readers don't wait indefinitely if a checkpoint briefly holds the lock.Index on snapshots(recorded_at, motion) (V5 migration)
The calendar view's
GROUP BY dayquery was doing a full table scan on every page load. The new composite index turns it into a single-pass index-only scan, and also speeds up unfiltered day-range queries.Tests
WuMing
Found 1 issue(s). See inline comments below.
@ -13,3 +13,3 @@if: github.event_name == 'pull_request'steps:- uses: https://codeberg.org/marvin8/wuming@main- uses: https://forge.marvin8.zone/marvin8/wuming@mainsecurity [MEDIUM]
The workflow action is referenced with a mutable branch '@main' rather than a pinned commit SHA, making it vulnerable to supply chain attacks. An attacker who compromises the branch can inject malicious code and exfiltrate secrets such as 'forge.token'. OWASP A08: Software and Data Integrity Failures. Remediate by pinning to a specific, verified commit hash.
line 15
✅ Pinning to commit
d4ef1c6— the current HEAD of wuming's main branch.forgejo/workflows/ci.yml line 15
✅ Pinning to commit
d4ef1c6— the current HEAD of wuming main branch.forgejo/workflows/ci.yml line 15
🔴 Declined — both the cang and wuming repos live on the same self-hosted forge instance. The generic supply-chain threat model (external attacker compromising a third-party action branch) does not apply here. Pinned-SHA maintenance churn is not warranted for this trust boundary.
WuMing
Found 1 issue(s). See inline comments below.
@ -42,3 +42,3 @@- id: gitleaks- repo: https://codeberg.org/marvin8/zaojun- repo: https://forge.marvin8.zone/marvin8/zaojunsecurity [MEDIUM]
A08: The pre-commit hook is fetched from a mutable branch (no pinned revision) without integrity verification. If the remote repository or its domain is hijacked, arbitrary code could run on developer machines. Use a specific commit SHA in the repo URL or verify signatures to prevent tampering.
- Add bumpversion rule for docker pull line (cang:{version}) — was missed, so the docker pull command in Release-Notes.md never got updated on version bumps - Fix Release-Notes.md.template: use YYYY.MM.DD placeholder matching the sed pattern in reset-release-notes - Fix current docker pull version in Release-Notes.md (2026.7.25 → 2026.8.4) - Remove docs/javascripts/redirect.js and its mkdocs reference — no redirects needed, cang was never on Codeberg Pages