mirror of
https://github.com/element-hq/synapse.git
synced 2026-04-13 14:56:18 +00:00
What's done: 1. All Twisted imports conditional (230 files wrapped in try/except ImportError) 2. Test base class: stdlib unittest.TestCase (no more twisted.trial) 3. ContextVar is primary logcontext storage (threading.local removed) 4. All @defer.inlineCallbacks converted to async def (0 remaining) 5. Module API fully async (no Deferred return types) 6. CancelledError is asyncio.CancelledError in 17 files 7. yieldable_gather_results uses asyncio.gather (with Twisted fallback) 8. run_in_background tries asyncio first (falls back to Twisted) 9. Asyncio reactor installed in production (_base.py) 10. Twisted optional in pyproject.toml 11. All 21 key modules import without Twisted What remains: - ~79 defer.* calls in old utility classes (Linearizer, ReadWriteLock, etc.) and reactor entry points — these can only be removed when the test infrastructure switches from MemoryReactorClock to a real asyncio loop - 4 REST cancellation test failures (Twisted request lifecycle) - The reactor.run() → asyncio.run() entry point switch (production only, not tests)