Repository navigation
fix(audit): 修复 F088 并发重复回收与迁移 update_time 覆盖 - #2880
Merged
Merged
Conversation
…mestamps Concurrent cleanup tasks could both pass the row-lock check and create two recycle batches and audits for the same file. Add an atomic abnormal_auto_delete_claimed_at claim with a 15-minute takeover window, release it after each attempt, and keep the existing status/category checks. The f125 backfill now writes update_time back to itself so ON UPDATE CURRENT_TIMESTAMP cannot replace historical failure times with the deploy time. Include a claim-column migration f126 and regression tests for concurrent claims and the repository-level claim. Tests: backend 70 passed. Existing 171 rows already rewritten by the old f125 are exempt and cannot recover the lost timestamps without a backup.
likaiaki
added a commit
that referenced
this pull request
Dec 3, 2026
## What 审计异常文件列表中,鼠标悬停到被禁用的「重新解析」按钮时显示提示: - 内容违规:`此文件因内容违规,无法使用。平台将于1个工作日后自动删除文件,请上传符合要求的文档。` - 归属已更新:`此文件因归属已更新,无法重新解析。平台将于1个工作日后自动删除文件,请上传符合要求的文档。` - 历史豁免记录:只显示原因与上传建议,不显示 1 个工作日删除说明。 - 其他可重试记录:不显示该提示。 实现使用 `bs-ui` 的 Radix Tooltip,禁用按钮外层加 `<span>` 承载鼠标事件;替换原生 `title`,不改变按钮禁用/点击行为。三语文案已补齐。 本次同时记录 171 复测验收结果:并发同一文件只产生一批回收/一条审计;全新 MySQL 8.0 f125 保留历史 `update_time`。 ## Why - 只有灰按钮没有原因说明,用户不知道为何不能重新解析、文件何时被处理。 - 历史豁免记录不会再自动删除,不能展示删除承诺。 ## 范围说明 本次只覆盖当前被禁用的两类(内容违规、归属已更新)。加密/损坏/格式不支持在 F087 中仍保持可重新解析,按钮未禁用,因此未加禁用提示;如需把它们也改为不可重试,请另开需求。 ## Test - 平台:**73 passed**(悬停 helper、豁免变体、三语文案、既有预览回归)。 - TypeScript:仅既有 `TS2802`。 - 未改后端代码。 ## Related - F088 首轮:#2877;修复:#2880 - 验收记录:`features/v2.5.0-sg/088-abnormal-file-auto-delete/acceptance.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
F088 首轮 171 验收发现两处阻塞,本 PR 只包含修复:
abnormal_auto_delete_claimed_at原子认领(迁移f126,15 分钟 TTL)。并发任务只有一个UPDATE ... WHERE claimed_at IS NULL OR claimed_at < now-15m能拿到 rowcount=1,另一个跳过;删除成功/失败/跳过都会释放认领,认领/释放显式写回update_time。f125的豁免 UPDATE 改为SET abnormal_auto_delete_exempt=1, update_time=update_time,避免ON UPDATE CURRENT_TIMESTAMP把历史异常行的失败时间改成部署时间。Why
update_time全部改成部署时刻。Test
update_time不变、exempt 变 1;旧语句会改成执行时刻。ruff check/ruff format --check、pre-commit 钩子、arch-guard通过。171 复测注意
f126,确认abnormal_auto_delete_claimed_at列存在。update_time无备份不可恢复;历史行已 exempt、不会被自动删除,仅展示/排序受影响。f125保留修复只对全新迁移生效。abnormal_upload.auto_delete审计;claim 释放后为空。Related
491b79e275)91d941337dv2_6_0_f126_abnormal_auto_delete_claim;v2_6_0_f125_abnormal_auto_delete修正features/v2.5.0-sg/088-abnormal-file-auto-delete/acceptance-handoff.md🤖 Generated with Claude Code