From ecb5572e693a8ab9fa411d30455c51cf80879b6a Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Wed, 28 Jan 2026 19:25:15 +0200 Subject: [PATCH] fix(backend): remove inaccessible podcast references when cloning chats When a podcast can't be cloned (not READY), remove the podcast_id from the cloned message to prevent 403 errors when users try to access it. --- surfsense_backend/app/services/public_chat_service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/surfsense_backend/app/services/public_chat_service.py b/surfsense_backend/app/services/public_chat_service.py index 79618974f..a5b8c9ffe 100644 --- a/surfsense_backend/app/services/public_chat_service.py +++ b/surfsense_backend/app/services/public_chat_service.py @@ -291,6 +291,9 @@ async def complete_clone_content( if old_podcast_id and old_podcast_id in podcast_id_map: result_data["podcast_id"] = podcast_id_map[old_podcast_id] + elif old_podcast_id: + # Podcast couldn't be cloned (not ready), remove reference + result_data.pop("podcast_id", None) new_message = NewChatMessage( thread_id=target_thread.id,