Fix stale cart count: commit transaction before cross-service fragment fetch

The cart-mini fragment relies on cart calling back to events for calendar/
ticket counts. Without committing first, the callback runs in a separate
transaction and misses the just-added entry or ticket adjustment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 10:30:13 +00:00
parent bcac8e5adc
commit 0c4682e4d7
3 changed files with 11 additions and 17 deletions

View File

@@ -125,7 +125,10 @@ def register() -> Blueprint:
# Load entry DTO for the widget template
entry = await services.calendar.entry_by_id(g.s, entry_id)
# Fetch OOB cart-mini fragment from cart service
# Commit so cross-service calls see the updated tickets
await g.tx.commit()
g.tx = await g.s.begin()
from shared.infrastructure.fragments import fetch_fragment
frag_params = {"oob": "1"}
if ident["user_id"] is not None: