Repository navigation
Resolve a relative data directory once, for both the files and the lock [patch] - #220
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
…ck [patch] JsonKeybindingRepository resolved its lock key with Path.GetFullPath at construction but kept the relative path for every file operation, so after the current directory changed a save went to another folder (and was lost on the next launch) while the lock still guarded the original one. The directory is now resolved once and that one path is used for both. Fixes #217 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW26R7a4LaEL6NnFvBq
|
3 tasks
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 #217
What changed
JsonKeybindingRepositoryresolved its lock key withPath.GetFullPathin the constructor, but kept the relative path for every file operation. Once the current directory changed (for example after anOpenFileDialogwithoutRestoreDirectory), saves went to a different folder and the rebind was lost on the next launch. The lock still guarded the original folder, so the #148 lost update came back too.The constructor now resolves the trimmed directory once. That one absolute path is used for the files and for the lock.
KeybindingManager,KeybindingManagerFactoryand the DI extensions all build their storage through this constructor, so they are covered as well.Tests
RelativeDataDirectoryTestsis new. It is[DoNotParallelize]because it changes the process-wide current directory, and it restores it in cleanup."data"undera/saves, the current directory moves tob/, and it saves again. Both profiles are ina/data, and nob/datais created.a/. The rebind is there.With the fix reverted, all three fail. With it, the full suite passes (384/384).
This may also settle #194, as the triage notes, but it doesn't claim to: the lock key there still depends on spelling (
datavsdata/, letter case).Generated by Claude Code