fix: portable mode re-prompting and stray trusted-plugins.json in AppData (#658)#659
Merged
Merged
Conversation
…Data (#658) Opening the settings dialog while portable mode was active fired the portable-mode CheckedChanged handler during FillDialog, re-running the activation flow (copy-settings question dialog, marker file) on every open. FillPortableMode now detaches the handler while syncing the checkbox from preferences and owns the Activate/Deactivate label. PluginValidator eagerly loaded the trust configuration in its static constructor, creating trusted-plugins.json in %APPDATA%/LogExpert before Initialize could point it at the active (portable) config directory. The configuration is now loaded lazily at Initialize or first use, so the file is only ever written to the active directory.
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 #658.
Settings dialog re-prompting: FillDialog set the portable-mode checkbox programmatically, which fired CheckedChanged and re-ran the full activation flow — copy-settings question dialog plus marker-file creation — on every Tools → Configure while portable mode was active. FillPortableMode now detaches the handler while syncing from preferences and owns the Activate/Deactivate label, so the flow only runs on a real user toggle.
trusted-plugins.json in AppData: PluginValidator's static constructor eagerly loaded (and created) the trust configuration at the hard-coded %APPDATA%\LogExpert path before Initialize could point it at the active configuration directory. The configuration now loads lazily at Initialize/first use, so in portable mode the file lands only in the portable configuration directory. Normal-mode behavior is unchanged.
Regression tests cover both: side-effect-free dialog population (with a timeout guard so a reintroduced modal fails instead of hanging CI) and lazy loading/persisting to the configured directory.