Repository navigation
feat(git): auto-fetch open repositories on a timer (DAN-89) - #153
Merged
Merged
Conversation
Settings → Git offers Off, 5, 10, or 30 minutes. Daniels chose 10 minutes as the default. Background fetch is fetch-only, staggered across open repositories, and fails quietly when credentials are missing. DAN-89. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
GetConsoleWindow returns *mut c_void on the current windows-sys, so the CREATE_NO_WINDOW probe compared a pointer with an integer and failed to compile on Windows CI. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
… fetch (DAN-89) GIT_SSH_COMMAND outranks core.sshCommand, so forcing BatchMode unconditionally dropped a user's custom key or ssh. Only force it when no ssh command is configured. Pass -c core.askPass= so a configured askpass helper cannot prompt from a background tick. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
…vity rows (DAN-89) - The manual-op skip now follows the repository the op started on, not whichever tab is active when the tick runs. - Refresh after a background fetch goes through the store's coalesced refreshUpstream (meta per tab, refs through refreshRefs when active). - A successful fetch that printed nothing and brought no commits writes no activity entry. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
- Extract manualOpPath / isManualBusyRepo (no behaviour change) and test that a busy non-active repo is skipped while the active one fetches, that a tab switch mid-op keeps the skip, and that op end clears it. - The background-fetch command tests run in a fresh temp repo with the ssh probe blind to GIT_SSH_COMMAND, GIT_SSH and global/system config, so a developer's own ssh setup can't fail them. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
danielss-dev
marked this pull request as ready for review
October 19, 2026 14:16
danielss-dev
force-pushed
the
developements/auto-fetch-timer-22cf
branch
from
October 19, 2026 14:16
8795d50 to
7ab82c0
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.
https://linear.app/daniels-dev/issue/DAN-89
Default interval
Daniels chose 10 minutes. That is the shipped default, not a placeholder. The single constant is
DEFAULT_AUTO_FETCH_INTERVAL_MINinui/src/lib/autoFetch.ts. Settings → Git still offers Off, 5 min, 10 min, and 30 min, and each open repository can opt out.What Daniels should check live
Open two repositories. From another machine, push a commit to one remote. Wait one 10-minute interval. The behind-count for that branch should update, and a notice should appear (
N new commits on origin/<branch>). The other repository fetches a few seconds later. Confirm a background fetch never flashes a console window on Windows. A remote with no saved credential should fail once, quietly, and then wait instead of prompting every tick.Proof
ui/src/lib/autoFetch.test.ts(fires at the interval…,does not start a second fetch…,never runs two fetches…).git ls-files -s,git write-tree, and file bytes stay the same:background_fetch_one_tick_reports_new_commits_without_touching_worktree. Notice text:does not spawn a fetch until the interval, then surfaces a new-commit notice once.background_fetch_auth_failure_does_not_prompt(HTTP 401 plus a credential helper that would block) andrecords one quiet auth failure and does not spawn again until backoff ends.spawns no background fetch when the setting is offandspawns nothing when the interval is off…(wakeAtis null, the fetch spy is never called).prepare_git_command→crate::git_command()→CREATE_NO_WINDOW(background_fetch_command_uses_hidden_git_and_cannot_prompt). On Windows,console_probe::hidden_console_child_has_no_windowre-executes the test binary and checksGetConsoleWindow()is null.cargo clippy -p strand-core -p strand-tauri -p strand-ops -p strand-headless -p strand-azdo-protocol -p strand-azdo -- -D warningspassed;pnpm --filter ./ui exec tsc --noEmitpassed;pnpm --filter ./ui test(auto-fetch and settings) passed;cargo test -p strand-core --lib background_fetchpassed (4 tests).Fetch only. No auto-pull, no fetch of closed recent repos, no OS notification.
Review fixes
core.sshCommand/GIT_SSH_COMMAND/GIT_SSH. It only forcesssh -o BatchMode=yeswhen no ssh command is set.-c core.askPass=, so a configured askpass helper can't prompt.refreshUpstream. That refreshes meta per tab, and refs throughrefreshRefswhen the repo is active.autoFetch.ts:6) is unchanged, pending confirmation.background_fetch_keeps_the_users_core_ssh_command, plus askPass assertions.autoFetchIsNoop, and a store test forrefreshUpstream.manualOpPath/isManualBusyRepo(no behaviour change).GIT_SSH_COMMAND,GIT_SSHand global/system config.Merge order 157 → 153 → 155 → 154 → 156 → 158: no later PR in the stack touches these files, so none needs adapting for this one.