feat(web): iPhone PWA fixes (M1) + warm RTO redesign (M2) #3

Merged
serversdown merged 19 commits from dev into main 2026-06-21 02:10:53 -04:00
Showing only changes of commit cca8322ee2 - Show all commits
+5
View File
@@ -131,6 +131,11 @@ def _connection() -> sqlite3.Connection:
# alongside the web server without tripping "database is locked".
_conn.execute("PRAGMA busy_timeout=5000")
_conn.execute("PRAGMA journal_mode=WAL")
# WAL's recommended companion: don't fsync on every commit (only at
# checkpoint). Safe against app crashes; a power/OS crash can lose the last
# txn but never corrupt. On disk-backed storage this turns ~0.15s-per-commit
# fsync latency into ~nothing — big win for per-turn writes + the dream loop.
_conn.execute("PRAGMA synchronous=NORMAL")
_conn.executescript(SCHEMA)
# Migrations for DBs created before a column existed (no-op if present).
for ddl in ("ALTER TABLE sessions ADD COLUMN mode TEXT",):