Skip to content

Fix race condition in BranchesView data loading#40

Merged
Umaaz merged 4 commits into
mainfrom
sleek-reef
Apr 6, 2026
Merged

Fix race condition in BranchesView data loading#40
Umaaz merged 4 commits into
mainfrom
sleek-reef

Conversation

@Umaaz
Copy link
Copy Markdown
Contributor

@Umaaz Umaaz commented Apr 6, 2026

Summary

  • Add cancellation signal to BranchesView useEffect so stale async responses from prior renders are discarded
  • Fixes intermittent issue where branches page wouldn't load correctly (e.g. React strict mode double-mount or project switching while fetch is in-flight)

Test plan

  • Open branches view, verify branches load correctly
  • Switch projects while branches are loading, confirm no stale data appears
  • Use Fetch & Prune, verify it still refreshes correctly

🤖 Generated with Claude Code

Umaaz and others added 4 commits April 7, 2026 00:04
Add cancellation signal to the useEffect that fetches branch data so
stale responses from prior renders don't overwrite current results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use git branch --all to fetch both local and remote branches. Remote
branches without a local counterpart are shown with a "remote" badge.
Deduplicates by preferring local branches when both exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
git branch --format does not interpret %x00 as NUL bytes in git 2.43.
git for-each-ref with %00 produces actual NUL bytes, fixing branch
parsing that was silently returning empty results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Umaaz Umaaz enabled auto-merge April 6, 2026 22:29
@Umaaz Umaaz merged commit 3a1a7b5 into main Apr 6, 2026
3 checks passed
@Umaaz Umaaz deleted the sleek-reef branch April 6, 2026 22:30
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.

1 participant