fix(calendar): keep default creation transactional (#5806)

* fix(calendar): keep default creation transactional

* fix(calendar): serialize default calendar creation

* fix(calendar): handle renamed default id collisions

---------

Co-authored-by: Alexandre Teixeira <111787685+alteixeira20@users.noreply.github.com>
This commit is contained in:
RaresKeY
2026-08-12 04:51:52 +01:00
committed by GitHub
co-authored by Alexandre Teixeira
parent 858c872832
commit 3f9633c44f
3 changed files with 656 additions and 7 deletions
+3
View File
@@ -196,6 +196,9 @@ async def do_manage_calendar(content: str, owner: Optional[str] = None) -> Dict:
try:
if action == "list_calendars":
_ensure_default_calendar(db, owner)
# This read path intentionally persists the lazily-created default;
# event creation commits it in the event's transaction instead.
db.commit()
cals = _calendar_query().all()
result = [{"name": c.name, "href": c.id} for c in cals]
if result: