mirror of
https://github.com/velocitatem/cvfs.git
synced 2026-06-01 01:03:36 +00:00
Fix two critical backend bugs found during integration testing
- versions.py: eagerly load public_assets in create_branch and append_patches_to_version refresh queries; missing selectinload caused MissingGreenlet 500 on every branch creation - documents.py: null root_version_id before cascade delete to break the circular FK (cv_documents → cv_versions → cv_documents), which was causing IntegrityError on every document deletion https://claude.ai/code/session_017HGM9VPptZG52asT5pbL6Y
This commit is contained in:
@@ -99,6 +99,9 @@ async def delete_document(
|
||||
await session.execute(
|
||||
delete(PublicAsset).where(PublicAsset.version_id.in_(version_ids))
|
||||
)
|
||||
# Null root_version_id to break the circular FK before cascade
|
||||
doc.root_version_id = None
|
||||
await session.flush()
|
||||
await session.delete(doc)
|
||||
await session.commit()
|
||||
for key in artifact_keys:
|
||||
|
||||
Reference in New Issue
Block a user