Skip to content

Conversation

@xbingW
Copy link
Contributor

@xbingW xbingW commented Jan 6, 2026

PR 标题

修复文档重新发布导致 group ids 丢失的问题

变更类型

请勾选适用的变更类型:

  • Bug 修复 (不兼容变更的修复)
  • 新功能 (不兼容变更的新功能)
  • 功能改进 (不兼容现有功能的改进)
  • 文档更新
  • 依赖更新
  • 重构 (不影响功能的代码修改)
  • 测试用例
  • CI/CD 配置变更
  • 其他 (请描述):

变更内容

详细描述本次 PR 的具体变更内容:
1.
2.
3.

测试情况

描述本次变更的测试情况:

  • 已本地测试
  • 已添加测试用例
  • 不需要测试 (理由: )

其他说明

任何其他需要说明的事项:

Copilot AI review requested due to automatic review settings January 6, 2026 11:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where group IDs are lost when documents are republished. The fix changes the condition for setting group IDs and tags from checking if the slice length is greater than zero to checking if the slice is not nil, allowing empty slices to be properly stored as metadata (important for representing closed access). A data migration is included to fix existing documents that lost their group IDs.

Key Changes

  • Modified group ID and tag metadata checks to use nil comparison instead of length checks
  • Added migration to restore missing group IDs for all existing node releases based on current node permissions

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backend/store/rag/ct.go Changed group ID and tag checks from length-based to nil-based to allow empty slices in metadata
backend/migration/fns/0003_fix_group_ids.go New migration that reconstructs group IDs for existing node releases based on node permissions
backend/migration/func.go Registered the new fix group IDs migration function
backend/migration/fns/provider.go Added new migration to dependency injection provider set
backend/cmd/migrate/wire_gen.go Wire-generated code updated to include new migration dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 6, 2026 11:47
@coltea coltea merged commit 61ce2b2 into chaitin:main Jan 6, 2026
10 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants