c54e2be5c43aaf394649ec735248c4a2459df7c7
When the frontend passes a conversation_id that does not exist in the conversations table (e.g. new conversation before first message, or invalid ID), the INSERT into attachments failed with ForeignKeyViolationError. Now upload_attachment checks session.get(Conversation, conversation_id) before inserting. If the conversation does not exist, conversation_id is set to None and the attachment is stored as unlinked (blob path uses _unlinked/ prefix). This avoids the FK constraint error while keeping the file safely uploaded. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Description
No description provided
17 MiB
Languages
TypeScript
98%
CSS
1.1%
JavaScript
0.6%
Dockerfile
0.1%