diff --git a/tests/test_wal_checkpoint_strategy.py b/tests/test_wal_checkpoint_strategy.py index 7f479934f6d96..a38a41ffd7b59 100644 --- a/tests/test_wal_checkpoint_strategy.py +++ b/tests/test_wal_checkpoint_strategy.py @@ -137,7 +137,16 @@ class TestVacuumUsesPassive: """Manual vacuum paths must checkpoint PASSIVE, never TRUNCATE.""" def test_vacuum_uses_passive_before_vacuum(self, db): - """SessionDB.vacuum() checkpoints PASSIVE before running VACUUM.""" + """SessionDB.vacuum() checkpoints PASSIVE before VACUUM. + + A TRUNCATE checkpoint AFTER the VACUUM is expected: VACUUM rewrites + every page through the WAL, so without it a 3 GB database leaves a + 3 GB state.db-wal behind and `sessions optimize` becomes a net disk + LOSS. The #45383 tearing concern is about truncating while another + writer is mid-transaction — the pre-VACUUM checkpoint stays PASSIVE + for that reason; the post-VACUUM truncate runs under the same + exclusive-lock window the VACUUM itself required. + """ real_conn = db._conn tracking_conn = TrackingConnection(real_conn) db._conn = tracking_conn @@ -152,12 +161,13 @@ class TestVacuumUsesPassive: vacuum_calls = [ c for c in tracking_conn.execute_calls if c.strip().upper() == "VACUUM" ] - assert truncate_calls == [] assert passive_calls == ["PRAGMA wal_checkpoint(PASSIVE)"] assert vacuum_calls == ["VACUUM"] - assert tracking_conn.execute_calls.index( - passive_calls[0] - ) < tracking_conn.execute_calls.index(vacuum_calls[0]) + assert truncate_calls == ["PRAGMA wal_checkpoint(TRUNCATE)"] + vacuum_index = tracking_conn.execute_calls.index(vacuum_calls[0]) + assert tracking_conn.execute_calls.index(passive_calls[0]) < vacuum_index + # TRUNCATE must come only AFTER the VACUUM (never before it). + assert tracking_conn.execute_calls.index(truncate_calls[0]) > vacuum_index def test_optimize_storage_uses_passive_after_vacuum(self, db): """optimize_fts_storage() checkpoints PASSIVE after its VACUUM.""" diff --git a/tools/lazy_deps.py b/tools/lazy_deps.py index dd1eea50e8b5f..9cddb9a04260b 100644 --- a/tools/lazy_deps.py +++ b/tools/lazy_deps.py @@ -203,7 +203,7 @@ LAZY_DEPS: dict[str, tuple[str, ...]] = { "memory.mem0": ("mem0ai==2.0.10",), # ─── Messaging platforms (lazy-installable on demand) ────────────────── - "platform.telegram": ("python-telegram-bot[webhooks]==22.6",), + "platform.telegram": ("python-telegram-bot[webhooks]==22.8",), # brotlicffi gives aiohttp a working 2-arg Decompressor.process() for # Discord CDN's Brotli-encoded attachments. Without it, aiohttp falls # back to google's `Brotli` package (1-arg API), and any .txt/.md/.doc @@ -219,12 +219,12 @@ LAZY_DEPS: dict[str, tuple[str, ...]] = { "aiohttp==3.14.3", # prior CVEs + GHSA-cq5v-8q36-5273/GHSA-mfx4-hv73-q22v/GHSA-mq44-7p77-q5h7 ), "platform.slack": ( - "slack-bolt==1.29.0", + "slack-bolt==1.30.0", "slack-sdk==3.43.0", "aiohttp==3.14.3", # prior CVEs + GHSA-cq5v-8q36-5273/GHSA-mfx4-hv73-q22v/GHSA-mq44-7p77-q5h7 ), "platform.matrix": ( - "mautrix[encryption]==0.21.0", + "mautrix[encryption]==0.21.1", "aiosqlite==0.22.1", "asyncpg==0.31.0", "aiohttp-socks==0.11.0",