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
14 MiB
Languages
TypeScript
89.2%
CSS
4.3%
Makefile
2.9%
JavaScript
2.5%
Dockerfile
0.5%
Other
0.6%