Repository navigation
fix(deployment): link to the staged file without a doubled separator - #24477
Open
Ramnath0521 wants to merge 1 commit into
Open
Ramnath0521 wants to merge 1 commit into
Ramnath0521 wants to merge 1 commit into
Conversation
|
This PR has conflicts. You need to rebase the PR before it can be merged. |
LinkingActivator built the source path of each deployed file by joining strings with path.sep. A staging path configured with a trailing separator gave a doubled one, but the OS normalizes the symlink target, so isLink() compared a single-separator readlink result against the doubled path and reported every deployed file as changed outside of Vortex. Build both source paths with path.join so they always agree. Fixes Nexus-Mods#24408 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ramnath0521
force-pushed
the
fix/issue-24408
branch
from
October 12, 2026 15:21
33bd44a to
7b68f74
Compare
|
This PR doesn't have conflicts anymore. It can be merged after all status checks have passed and it has been reviewed. |
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.
Fixes #24408
Cause
LinkingActivatorbuilds the source path of every deployed file by joining strings withpath.sep:When the staging path is configured with a trailing separator (for example
E:/Modding/Vortex-Data/Staging/witcher3/), that produces a doubled separator before the mod folder:.../Staging/witcher3//<mod>/..., which is what the log in the issue shows.The operating system normalizes the link target when the symlink is created, so
readlinklater returns the path with a single separator.isLink()in the symlink activators compares that against the un-normalizedsourcePathas plain strings (symlinkPath === sourcePath), so they never match andexternalChanges()reports every file of the previous mod as changed outside of Vortex.Change
Build the two source paths with
path.joininstead of[...].join(path.sep), indeployFile()(the path the link is created with) and inexternalChanges()(the path it is checked against).path.joincollapses the doubled separator, so both sides agree whatever the configured staging path looks like. No other behaviour changes.I left the data (game) path joins alone: they are only used as the location of the link, not compared against a
readlinkresult.Test
LinkingDeployment.test.tsgets one test that runs the real symlink deployment method through the existingmakeDeploymentharness with a staging path that ends in a separator, and asserts the target passed tosymlinkAsyncispath.join(stagingDir, modName, "mod.ini").symlinkAsyncis stubbed so the test does not need symlink privileges (creating symlinks needs Developer Mode or admin on Windows)....\staging\SomeMod\mod.ini...\staging\\SomeMod\mod.iniWhat I ran, and what I did not
On Windows 11 / Node 24, from
src/renderer:pnpm exec vitest run src/extensions/mod_management src/extensions/hardlink_activator src/extensions/move_activator: 45 files, 488 tests pass.oxfmt --checkandeslint --quietclean on the two changed files.tscreports nothing in the changed lines; its only error in these files isCannot find module '@vortex/shared', because I did not build that package locally.I did not run
pnpm run verify, the full build, or an end-to-end run with a real symlink deployment of a game: this machine cannot create symlinks without elevation. To get the renderer tests to load I installed with lifecycle scripts disabled, sowinapi-bindingswas not built and I used a throwaway local stand-in for it (not part of this change).Written with AI assistance (Claude Code). I reproduced the failure on my own Windows machine, read the diff, and verified the added test fails before the fix and passes after. Errors are mine.
🤖 Generated with Claude Code