fix: keep old versions visible in cross-review task instead of retiring them
This commit is contained in:
@@ -911,30 +911,6 @@ class CrossReviewServiceImpl(ICrossReviewService):
|
|||||||
await self._ensure_tables_ready(session)
|
await self._ensure_tables_ready(session)
|
||||||
await self._reset_transaction_for_write(session)
|
await self._reset_transaction_for_write(session)
|
||||||
async with session.begin():
|
async with session.begin():
|
||||||
# If this is v{n>1}, retire previous versions in this task
|
|
||||||
if uploadResult.versionNo > 1 and uploadResult.versionGroupKey:
|
|
||||||
await session.execute(
|
|
||||||
text(
|
|
||||||
"""
|
|
||||||
UPDATE leaudit_cross_review_task_documents
|
|
||||||
SET delete_time = NOW()
|
|
||||||
WHERE task_id = :task_id
|
|
||||||
AND delete_time IS NULL
|
|
||||||
AND document_id IN (
|
|
||||||
SELECT id FROM leaudit_documents
|
|
||||||
WHERE version_group_key = :group_key
|
|
||||||
AND deleted_at IS NULL
|
|
||||||
AND id != :new_doc_id
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
),
|
|
||||||
{
|
|
||||||
"task_id": TaskId,
|
|
||||||
"group_key": uploadResult.versionGroupKey,
|
|
||||||
"new_doc_id": uploadResult.documentId,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
exists = bool(
|
exists = bool(
|
||||||
await session.scalar(
|
await session.scalar(
|
||||||
text(
|
text(
|
||||||
|
|||||||
Reference in New Issue
Block a user