Spaces:
Runtime error
Runtime error
Kennedy Johnson Cursor commited on
Commit ·
cfa135c
1
Parent(s): ef021f6
Fix CI failures from missing bulk-delete route and duplicate release tags.
Browse filesRestore DELETE /chat-sessions for unit tests, and skip GitHub release creation when the version tag already exists so non-version main merges do not fail.
Co-authored-by: Cursor <cursoragent@cursor.com>
.github/workflows/publish_release.yml
CHANGED
|
@@ -29,3 +29,6 @@ jobs:
|
|
| 29 |
token: ${{ secrets.GITHUB_TOKEN }}
|
| 30 |
tag: ${{ env.VERSION }}
|
| 31 |
generateReleaseNotes: true
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
token: ${{ secrets.GITHUB_TOKEN }}
|
| 30 |
tag: ${{ env.VERSION }}
|
| 31 |
generateReleaseNotes: true
|
| 32 |
+
# Branding-only or other non-version main merges should not fail
|
| 33 |
+
# when the current __version__ already has a release/tag.
|
| 34 |
+
skipIfReleaseExists: true
|
multi_llm_chatbot_backend/app/api/routes/chat_sessions.py
CHANGED
|
@@ -258,6 +258,36 @@ async def save_message_to_session(
|
|
| 258 |
|
| 259 |
|
| 260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
@router.delete("/chat-sessions/{session_id}")
|
| 262 |
async def delete_chat_session(
|
| 263 |
session_id: str,
|
|
|
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
+
@router.delete("/chat-sessions")
|
| 262 |
+
async def delete_all_chat_sessions(
|
| 263 |
+
current_user: User = Depends(get_current_active_user)
|
| 264 |
+
):
|
| 265 |
+
"""Soft-delete all active chat sessions for the current user"""
|
| 266 |
+
try:
|
| 267 |
+
db = get_database()
|
| 268 |
+
|
| 269 |
+
result = await db.chat_sessions.update_many(
|
| 270 |
+
{
|
| 271 |
+
"user_id": current_user.id,
|
| 272 |
+
"is_active": True,
|
| 273 |
+
},
|
| 274 |
+
{"$set": {"is_active": False, "updated_at": datetime.utcnow()}},
|
| 275 |
+
)
|
| 276 |
+
|
| 277 |
+
deleted_count = result.modified_count
|
| 278 |
+
return {
|
| 279 |
+
"deleted_count": deleted_count,
|
| 280 |
+
"message": f"Successfully deleted {deleted_count} chat sessions",
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
except Exception as e:
|
| 284 |
+
logger.error(f"Error deleting all chat sessions for user {current_user.id}: {e}")
|
| 285 |
+
raise HTTPException(
|
| 286 |
+
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
| 287 |
+
detail="Could not delete chat sessions",
|
| 288 |
+
)
|
| 289 |
+
|
| 290 |
+
|
| 291 |
@router.delete("/chat-sessions/{session_id}")
|
| 292 |
async def delete_chat_session(
|
| 293 |
session_id: str,
|