fix(editor): 删除项目和账户时清理词库 / clean deleted vocabulary scopes - #791
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
新词库使用 scope_key,不在既有按 projectId/userId 清理的表集合中,删除项目或注销账户后会遗留已学习记录。现在两条删除路径先取得与学习操作相同的父行写锁,再精确清理本范围词库,防止并发写入留下孤儿。账户注销仍须官网传导成功后才清理本地数据。
The learned vocabulary uses scope_key and was omitted from existing project/account cleanup. Acquire the same parent-row write lock used by learning, then delete only the matching scope, preventing concurrent learning from leaving orphan records. Account cleanup still starts only after unified-account deletion succeeds.
验证 / Validation: JDK 21 compile and ProjectDeleteCascadeTest/AccountDeletionServiceTest pass. Real H2 test confirms deleting one project preserves another project's and personal entries; account tests verify lock→vocabulary→user deletion order and zero vocabulary deletion when upstream account deletion fails.
Follow-up to #784; dev-board#538. No new dependencies or schema changes.