Conversation
Owner
Author
|
@codex |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 919a157a2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } finally { | ||
| setLoading(false); | ||
| } | ||
| }, [keyword]); |
There was a problem hiding this comment.
Summary
- 已修复
StorageKVPage中loadKeys对输入态keyword的隐式依赖:loadKeys现在默认使用空字符串且依赖数组为[],避免用户每次输入都间接触发reloadAll及全量请求。. pages/src/pages/StorageKVPage.tsxL92-L103 - 已将
reloadAll改为显式调用loadKeys(""),把“全量刷新”行为限定在初始化、手动刷新、删除后刷新等明确场景,避免输入时的性能回归。. pages/src/pages/StorageKVPage.tsxL117-L123 - 已保留搜索行为:点击搜索/回车时仍通过
submitSearch -> loadKeys(keyword)发起按关键字查询,不影响原有交互。. pages/src/pages/StorageKVPage.tsxL125-L127
Testing
- ❌
go test ./...(仓库当前存在与本次改动无关的既有失败:internal/db与internal/model测试未通过)。 - ✅
git commit -m "fix: 避免 KV 页面输入时触发全量刷新"(已完成提交,commit:a4c06a7)。
另外,我已按要求调用 make_pr 记录本次后续 PR 标题与说明。
| return "", "", fmt.Errorf("key 不属于 Callit KV") | ||
| } | ||
| rest := strings.TrimPrefix(key, redisKeyPrefix) | ||
| parts := strings.SplitN(rest, ":", 2) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Summary
- 已修复
parseKVRedisKey的切分逻辑:从“按第一个冒号切分”改为“按最后一个冒号切分”,从而正确保留包含冒号的完整 namespace(如team:prod),避免管理页错误分组。. internal/admin/storage/kv_service.goL74-L90 - 保留并强化了 key 格式校验:当分隔位置非法或 namespace/name 为空时,仍返回格式错误,避免脏数据进入后续流程。. internal/admin/storage/kv_service.goL80-L88
- 新增单元测试覆盖:
- 合法场景:namespace 含冒号时可正确解析;
- 非法场景:空 key、缺失 name、空 namespace 等均会被拒绝。. internal/admin/storage/kv_service_test.goL5-L32
Testing
- ✅
gofmt -w internal/admin/storage/kv_service.go internal/admin/storage/kv_service_test.go - ❌
go test ./...(失败为仓库现有用例:internal/db的TestLatestPerWorkerUsesLatestInsertedLog、internal/model的TestWorkerLogIsSuccess,与本次 KV 解析改动无直接关联)
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.
No description provided.