[bug] Repository sync silently succeeds but indexed content is stale after branch rename/deletion
@brendan-kellam đang làm issue này rồi.
Từ ngày 23/3/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Describe the bug
After renaming or deleting a branch on the remote (GitHub/GitLab), Sourcebot's
next sync cycle completes without any errors in the logs, but the old branch
name continues to appear in the code search UI and the file explorer. The stale
branch remains fully searchable and navigable as if it still exists, with no
indication to the user that it has been removed upstream.
This is different from #248 (token rotation not reflected in cached remotes) —
here authentication is fine, the sync job runs successfully, but the
branch-level index is not pruned after a remote ref disappears.
Logs: Backend logs during the affected sync cycle (no errors shown despite stale
branch remaining):
[backend] | 2025-12-10T08:22:11.412Z info: [main] Fetching my-org/my-repo...
[backend] | 2025-12-10T08:22:12.103Z info: [main] Successfully fetched my-org/my-repo
[backend] | 2025-12-10T08:22:12.110Z info: [zoekt] Indexing my-org/my-repo...
[backend] | 2025-12-10T08:22:14.887Z info: [zoekt] Successfully indexed my-org/my-repo
To reproduce
- Deploy Sourcebot via
docker compose upwith a GitHub connection indexing
at least one repo that has multiple branches configured. - Confirm the branch (e.g.
feature/old-name) is visible and searchable in
the Sourcebot UI. - On GitHub/GitLab, rename or delete that branch.
- Wait for the next sync cycle to complete (or trigger a manual re-index).
- Observe the logs — sync completes with no errors.
- Return to the Sourcebot UI and search for content that only exists on the
deleted/renamed branch.
Sourcebot deployment information
Sourcebot version (e.g. v3.0.1): latest (v4.10.30)
Additional information
- The issue persists across container restarts — the stale branch is still
indexed after a full restart of the stack. - Workaround: manually deleting the Zoekt index data under the
/data/.sourcebotvolume and allowing a full re-index clears the stale
branch, but this is disruptive for large repos. - This may be related to how
git fetchis called during sync — if
--pruneis not passed, deleted remote refs are not removed from the
local clone's ref list, and Zoekt re-indexes whatever refs it finds locally.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.9k
- Fork
- 374
- Merge trung bình
- 21 giờ 18 phút
- Pull request đã merge (30 ngày)
- 39
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sourcebot-dev/sourcebot
-
bug triage needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
sourcebot-dev/sourcebot#1681 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
sourcebot-dev/sourcebot#1633 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sourcebot-dev/sourcebot#1384 · 4 bình luận ·
-
ask_sb bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
sourcebot-dev/sourcebot#1137 · 4 bình luận ·
-
bug triage needed
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
sourcebot-dev/sourcebot#1661 · 1 bình luận ·
Tất cả issue của sourcebot-dev/sourcebot
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fil-donadoni/tolaria#4409 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
corsairdev/corsair#1764 ·