Revert "fix(events): tolerate corrupt end_dt + reject end<=start at write time"

This reverts commit 94b169f31c.
This commit is contained in:
2026-04-29 14:18:01 -04:00
parent 94b169f31c
commit b7e7073425
4 changed files with 47 additions and 189 deletions
+17 -23
View File
@@ -213,25 +213,22 @@ async def create_event_tool(*, user_id, arguments, **_ctx):
proj = await resolve_project(user_id, project_name)
if proj:
project_id = proj.id
try:
event = await events_create_event(
user_id=user_id,
title=arguments.get("title", "Untitled Event"),
start_dt=start_dt,
end_dt=end_dt,
all_day=all_day,
description=arguments.get("description") or "",
location=arguments.get("location") or "",
color=arguments.get("color") or "",
recurrence=arguments.get("recurrence"),
project_id=project_id,
duration=arguments.get("duration"),
reminder_minutes=arguments.get("reminder_minutes"),
attendees=arguments.get("attendees"),
calendar_name=arguments.get("calendar_name"),
)
except ValueError as exc:
return {"success": False, "error": str(exc)}
event = await events_create_event(
user_id=user_id,
title=arguments.get("title", "Untitled Event"),
start_dt=start_dt,
end_dt=end_dt,
all_day=all_day,
description=arguments.get("description") or "",
location=arguments.get("location") or "",
color=arguments.get("color") or "",
recurrence=arguments.get("recurrence"),
project_id=project_id,
duration=arguments.get("duration"),
reminder_minutes=arguments.get("reminder_minutes"),
attendees=arguments.get("attendees"),
calendar_name=arguments.get("calendar_name"),
)
return {"success": True, "type": "event", "data": event.to_dict()}
@@ -363,10 +360,7 @@ async def update_event_tool(*, user_id, arguments, **_ctx):
return {"success": False, "error": f"Invalid end: {exc}"}
if end_dt is not None:
fields["end_dt"] = end_dt
try:
updated = await events_update_event(user_id=user_id, event_id=event_to_update.id, **fields)
except ValueError as exc:
return {"success": False, "error": str(exc)}
updated = await events_update_event(user_id=user_id, event_id=event_to_update.id, **fields)
if updated is None:
return {"success": False, "error": "Event not found or update failed."}
return {"success": True, "type": "event_updated", "data": updated.to_dict()}