Repository navigation
fix(web): prevent tree item version conflicts and enhance recovery - #47
Merged
Merged
Conversation
Ensure directory operations (reordering, single/batch deletion, and status changes) always consume the latest entity version and status from optimistic state projections. Gracefully handle version conflicts by triggering background synchronization and clear local optimistic overrides only when server responses reflect up-to-date revisions. Assisted-by: opencode/gemini-3.8-flash
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.
变更内容
moveWithinStatus)、单任务删除(deleteTask)、批量删除(deleteSelected)等操作中,统一通过latestItem/displayTask消费乐观状态中的最新版本与状态,防止由于旧版本号提交触发后端的VERSION_CONFLICT。handleTreeMutationError,当捕获到实体版本、状态或排序锚点冲突时,自动触发load()重新拉取服务端最新数据,并友好提示“数据版本已被更新,已自动同步最新状态,请重试”,消除界面卡死。验证结果
pnpm --filter @devtodo/web typecheck:通过(0 错误)vitest run test:通过(22 个测试套件,134 项测试全部通过)pnpm lint:通过(eslint 0 警告)pnpm tokens:check:通过