Skip to content

fix(daemon): normalize repo URL and clarify reposVersion intent#1090

Merged
Bohan-J merged 1 commit intomainfrom
fix/daemon-repo-nits
Apr 15, 2026
Merged

fix(daemon): normalize repo URL and clarify reposVersion intent#1090
Bohan-J merged 1 commit intomainfrom
fix/daemon-repo-nits

Conversation

@Bohan-J
Copy link
Copy Markdown
Collaborator

@Bohan-J Bohan-J commented Apr 15, 2026

What does this PR do?

Follow-up nit fixes from the review of #1085. Three small improvements:

  1. URL normalization: TrimSpace incoming repoURL in ensureRepoReady so URLs with whitespace still hit the fast path instead of triggering unnecessary server refreshes
  2. Comment clarification: Added inline comment on reposVersion field explaining it's stored for future version-based skip optimization (currently unused in comparison logic)
  3. Concurrency safety comment: Documented that syncWorkspacesFromAPI must not replace existing workspaceState pointers, since ensureRepoReady holds ws.repoRefreshMu from the original pointer

Related Issue

Follow-up from #1085 review

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Refactor / code improvement (no behavior change)
  • Tests (adding or improving test coverage)

Changes Made

  • server/internal/daemon/daemon.go: Added strings.TrimSpace(repoURL) at ensureRepoReady entry, added comment on reposVersion field, added concurrency safety comment on workspace skip logic
  • server/internal/daemon/daemon_test.go: Added TestEnsureRepoReadyTrimsURL test

How to Test

cd server && go test ./internal/daemon/ -run TestEnsureRepoReady -v

AI Disclosure

AI tool used: Claude Code

- TrimSpace incoming repoURL in ensureRepoReady to prevent unnecessary
  server refreshes when CLI passes URLs with whitespace
- Add comment on reposVersion field clarifying it is stored for future
  version-based skip optimization
- Add concurrency safety comment on syncWorkspacesFromAPI skip logic
- Add test for URL trimming fast-path behavior
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multica-web Ignored Ignored Apr 15, 2026 11:13am
multica-web-production Ignored Ignored Apr 15, 2026 11:13am

Request Review

@Bohan-J Bohan-J merged commit df920e8 into main Apr 15, 2026
5 checks passed
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