Skip to content

fix(server): prevent git auth loops during passive status refresh#1433

Open
ifBars wants to merge 4 commits intopingdotgg:mainfrom
ifBars:fix/windows-git-auth-loop
Open

fix(server): prevent git auth loops during passive status refresh#1433
ifBars wants to merge 4 commits intopingdotgg:mainfrom
ifBars:fix/windows-git-auth-loop

Conversation

@ifBars
Copy link
Contributor

@ifBars ifBars commented Mar 26, 2026

What Changed

  • Moved upstream refresh for passive git status reads onto a scheduled background path instead of awaiting it inside statusDetails().
  • Kept the longer fetchUpstreamRefForStatus timeout so Git Credential Manager login can complete when that scheduled refresh needs auth on Windows.
  • Added GitCore regression tests covering scheduled upstream refresh behavior, the extended refresh timeout, and deduplication of concurrent scheduled refreshes.

Why

On Windows, the desktop app could repeatedly open and close the GitHub/GCM auth window while the app was focused.

This happened when passive status polling triggered git fetch in a repo without cached GitHub credentials. In that state, Git Credential Manager needs time for the user to complete interactive login. The previous implementation awaited upstream refresh directly inside statusDetails() with a 5 second timeout, which killed the fetch before auth could finish and restarted the same flow on the next refresh.

This change keeps the longer auth window allowance on the passive refresh path, but removes that auth-sensitive fetch from blocking callers like statusDetails(), pushCurrentBranch(), and pullCurrentBranch().

Fixes #1418

Checklist

  • This PR is small and focused
  • I explained what changed and why

@coderabbitai
Copy link

coderabbitai bot commented Mar 26, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d51c0469-5f33-42b8-b5ce-5543a0b505d3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 26, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c36240a448

ℹ️ 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".

@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Mar 26, 2026
@ifBars ifBars changed the title fix(server): avoid timing out git auth during background status refresh fix(server): keep passive git status refresh off blocking paths Mar 26, 2026
@ifBars ifBars changed the title fix(server): keep passive git status refresh off blocking paths fix(server): prevent git auth loops during passive status refresh Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: App continue to trigger and close Github gcm auth request while in focus on Windows

1 participant