gabriel / musehub public
fix BREAKING ui dev #13 / 100
AI Agent gabriel · 1 day ago · Nov 15, 2026 · Diff

fix(ui): never run database coroutines concurrently on the request session — await them in order (#265)

Ten asyncio.gather sites in UI handlers (repo home, blob, commits, proposals ×3, releases, symbol detail, counts helper) and the OpenGraph card loader interleaved statements on one AsyncSession connection. musehub.db.in_order awaits them sequentially (a session per branch would multiply checkouts from the small web pool). Guard test: no UI module gathers; T601 now pins in_order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

sha256:141d2a1e63256ef4fa78fe8e13e81febdb37c203a5a4c19665b80c025ca19054 sha
+21 ~11 −6 symbols
sha256:98f9ccc31ec55e6d3c4a8c1e32e8050459b76ff02da62e757434530973fdf951 snapshot
+21
symbols added
~11
symbols modified
−6
symbols removed
0
dead code introduced
Semantic Changes 38 symbols
~ musehub/db/in_order.py .py 4 symbols added
+ Any import import Any L11–11
+ Awaitable import import Awaitable L10–10
+ annotations import import annotations L8–8
+ in_order function async_function in_order L14–19
+ _ROOT variable variable _ROOT L15–15
+ _SCOPE variable variable _SCOPE L16–17
+ annotations import import annotations L6–6
+ asyncio import import asyncio L8–8 ← moved from musehub/api/routes/musehub/ui_repo.py
+ in_order import import in_order L13–13
+ pathlib import import pathlib L9–9
+ pytest import import pytest L11–11
+ test_in_order_awaits_sequentially_and_keeps_order function function test_in_order_awaits_sequentially_and_keeps_order L25–36
+ test_no_ui_handler_gathers_database_work function function test_no_ui_handler_gathers_database_work L21–22
~ musehub/api/routes/musehub/_ui_helpers.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
− asyncio import import asyncio L7–7
+ in_order import import in_order L23–23
~ musehub/api/routes/musehub/ui_blob.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
− asyncio import import asyncio L11–11
+ in_order import import in_order L323–323
~ musehub/api/routes/musehub/ui_commits.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
− asyncio import import asyncio L12–12
+ in_order import import in_order L39–39
~ musehub/api/routes/musehub/ui_proposals.py .py 1 symbol added, 1 symbol removed, 2 symbols modified
− asyncio import import asyncio L11–11
+ in_order import import in_order L44–44
~ musehub/api/routes/musehub/ui_releases.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
− asyncio import import asyncio L10–10
+ in_order import import in_order L31–31
~ musehub/api/routes/musehub/ui_repo.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
− asyncio import import asyncio L9–9 → moved to tests/test_ui_session_in_order_265.py
+ in_order import import in_order L36–36
~ musehub/api/routes/musehub/ui_symbols.py .py 1 symbol added, 1 symbol modified
+ in_order import import in_order L69–69
~ musehub/services/opengraph_cards.py .py 1 symbol added, 1 symbol modified
+ in_order import import in_order L28–28

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:141d2a1e63256ef4fa78fe8e13e81febdb37c203a5a4c19665b80c025ca19054 --body "your comment"