fix: classify a fork by owner alone, so renaming it doesn't disable fork detection - #6141
Merged
atomantic merged 1 commit intoSep 4, 2026
Merged
Conversation
…ork detection classifyOriginRemote() required both a different owner AND a matching repo name to classify an origin as a fork. Renaming a fork on GitHub (<owner>/PortOS -> <owner>/PortOS-Fork) silently flipped isFork to false — git/gh repo sync keep working through GitHub's slug redirect, but the fork panel, POST /api/update/sync-fork, the FORK_SYNC_REQUIRED update guard, and the divergence check all disappear with no warning. Drops the repo-name requirement: any GitHub origin under an owner other than upstream now classifies as a fork. The tradeoff (a genuinely unrelated GitHub origin also classifies as a fork) is accepted deliberately — its failure mode is a clear gh repo sync error, not four silently missing features. Refs atomantic#5931
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
classifyOriginRemote()required both a different owner AND a matching repo name to classify an origin as a fork (server/lib/gitRemote.js).<owner>/PortOS-><owner>/PortOS-Fork) silently flipsisForktofalse—git/gh repo synckeep working through GitHub's slug redirect, but the fork panel,POST /api/update/sync-fork, theFORK_SYNC_REQUIREDupdate guard, and the divergence check all disappear with no warning.isFork = isGithub && !ownerMatchesUpstream. Any GitHub origin under an owner other than upstream now classifies as a fork.gh repo syncerror, not four silently missing features.Test plan
gitRemote.test.js— updated the case that used to assertisFork: falsefor a differently-named repo under a different owner (nowtrue, matching the new intended behavior), added a renamed-fork-of-PortOS case.npx vitest run lib/gitRemote.test.js routes/update.test.js services/updateChecker.test.js services/updatePreflightParity.test.js— 128/128 passing, no regressions in the four downstream consumers the issue named.Closes #5931
🤖 Generated with Claude Code