oliver-zehentleitner / maity
hub: report routes run idempotency.run off the event loop; guard test for sync DB calls in async routes
tsk-pzex5cpkv6tx Done An agent
Found by nrk4 while #1843's web-e2e was flaky (not caused by #1843).
hub/src/maity_hub/routes/reports.py: file_report and resolve_report are async def and call idempotency.run synchronously on the event loop. On SQLite this blocks the async auth transaction and answers 503 after the 5 s busy timeout.
Fix: run the call in the thread pool (run_in_threadpool, as routes/auth.py:174 does), plus a guard test that scans async def routes for synchronous DB calls, so the next one is caught.
Checks: black --check, ruff, mypy; the reports tests, the new guard test, test_contract_*; web-e2e green twice in a row.