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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user