fix: prevent UI freeze on large repos with timeout protection and adaptive polling#20
Draft
fix: prevent UI freeze on large repos with timeout protection and adaptive polling#20
Conversation
- Add 30s default timeout to all git commands to prevent hung processes - Increase git command buffer sizes from 5MB/10MB to 50MB for large repos - Make git status polling adaptive: 15s interval for slow repos (>5s refresh), 3s for normal repos - Add getGitDirSize IPC handler to detect very large .git directories - Track refresh duration per repo and mark repos as "large" if refresh takes >5s - Warn in console when detecting .git directories >10GB - Update RepoState interface to track isLargeRepo and lastRefreshDuration Co-authored-by: OpenSource03 <29690431+OpenSource03@users.noreply.github.com>
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
Type of Change
Related Issues
Addresses issue where opening large repositories (3GB code, 16GB .git) caused system freeze.
How to Test
Screenshots / Screen Recording
N/A - performance/timeout fix with console warnings
Technical Details
Timeout Protection (
electron/src/lib/git-exec.ts):Adaptive Polling (
src/hooks/useGitStatus.ts):duration = performance.now() - startTimeisLargeRepo: truepollInterval = hasLargeRepo ? 15000 : 3000Size Detection (
electron/src/ipc/git.ts):getGitDirSize()IPC handler usingdu -sk .gitwith 5s timeoutChecklist
pnpm build)anytypes introducedms-*/me-*instead ofml-*/mr-*)wrap-break-wordshared/types/, notsrc/types/Original prompt