feat(network): add fetch timeouts to GitHub API and Git operations#3747
Merged
gregpriday merged 4 commits intodevelopfrom Mar 19, 2026
Merged
Conversation
Collaborator
Author
|
Review status: Rebased and ready
|
- Add createGit() factory with 30s rolling block timeout for all simpleGit calls - Add per-call AbortSignal.timeout(15s) to all @octokit/graphql calls - Add AbortSignal.timeout to raw fetch() calls in GitHubAuth, GitHubService, githubCreateIssue - Update parseGitHubError and GitHubAuth.validate to detect TimeoutError - Replace all 29 simpleGit() call sites across 10 files with createGit() - Export GITHUB_API_TIMEOUT_MS and GITHUB_AUTH_TIMEOUT_MS from github module
- Add createGit to vi.mock for utils/git.js in WorkspaceService and WorktreeMonitor tests
- Add test for TimeoutError mapping to network error message - Add test verifying AbortSignal is passed to fetch during validation
- Merge createGit (timeout) and createHardenedGit (security config) into single function - Add GIT_BLOCK_TIMEOUT_MS (30s) to createHardenedGit options - Update all imports from createGit to createHardenedGit across services - Update test mocks to reference hardenedGit.js instead of simple-git
84a5f17 to
45d7bef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
timeoutconstructor optionparseGitHubErrorhandler and cache fallback, so timed-out requests serve stale data instead of freezing the UIResolves #3697
Changes
electron/services/github/GitHubAuth.ts—createClient()now accepts an optionalAbortSignaland wires it into the Octokit request optionselectron/services/GitHubService.ts— All GraphQL calls create anAbortControllerwith 15s timeout; REST fetch usesAbortSignal.timeout()electron/services/GitService.ts—simpleGit()constructor receives timeout configelectron/utils/git.ts—createGit()utility updated with timeout parameterelectron/workspace-host/WorkspaceService.tsandWorktreeMonitor.ts— git instances created with timeoutscreateGit()Testing
GitHubAuthtimeout error handlingcreateGitsignature changenpm run checkpasses clean (typecheck + lint + format)