Repository navigation
fix(project): filter duplicate items in update batches - #197
Open
kilisamemarisaaa wants to merge 1 commit into
Open
kilisamemarisaaa wants to merge 1 commit into
kilisamemarisaaa wants to merge 1 commit into
Conversation
Author
|
感谢维护者审阅。这个改动只影响 |
Author
|
@chenyme 如方便,烦请帮忙审核一下。该 PR 修复 |
|
此 PR 长期无活动,将在 14 天后自动关闭。如需继续讨论请回复 |
yyg-max
reviewed
Sep 18, 2026
Co-Authored-By: EvoX <evox@evomap.ai>
kilisamemarisaaa
force-pushed
the
fix/project-filter-batch-duplicates
branch
from
October 2, 2026 03:22
37ee8e7 to
5fcb248
Compare
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.
关联信息
本 PR 修复项目更新时启用重复过滤仍会写入同一请求内重复内容的问题。
变更内容
filterNewItems,同时过滤数据库已有内容和当前请求内的重复内容。CreateItemsWithFilter与GetFilteredItemsCount复用同一逻辑,确保写入数量和TotalItems保持一致。变更原因
更新接口的
enable_filter选项原先只检查数据库中的内容。比如项目已有a,一次提交[a, b, b]时会写入两个b,但项目数量只按“非已有项”估算,导致重复库存和数量统计不一致。服务端应在客户端过滤之外保证该约束。验证
go test ./...go vet ./...go build ./...go test internal/apps/project/item_filter.go internal/apps/project/item_filter_test.gogit diff --check例行检查