fix: don't skip user presets when parent preset is not found#10875
Open
BenJule wants to merge 1 commit into
Open
fix: don't skip user presets when parent preset is not found#10875BenJule wants to merge 1 commit into
BenJule wants to merge 1 commit into
Conversation
When loading user presets, if the 'inherits' parent preset cannot be found (e.g. because a system preset was renamed or removed by an app update), the preset was silently skipped with a 'continue'. From the user's perspective the preset appeared to vanish after restarting. Instead, fall back to the built-in default config and emit a warning. The user's saved values are still applied on top of the default, so their settings are preserved as well as possible. The preset appears in the list and the user can correct any values that depended on the now- missing parent. Fixes bambulab#10869.
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
Fixes #10869
Root Cause
In
PresetCollection::load_presets()(src/libslic3r/Preset.cpp), when a user preset has aninheritsfield that points to a system preset that no longer exists (e.g. because it was renamed or removed in a system update), the preset is silently skipped:From the user's perspective the preset appears to be gone after restarting the application, even though the file is still on disk. This explains why the workaround of recreating the
Userdirectory helps — it forces the user to re-create presets under the current system-preset names, so the parent is always found.The bug can be triggered whenever:
inheritsreference still points to the old nameFix
Instead of
continue-ing (dropping the preset), fall back to the built-in default config and emit awarninglog entry. The user's saved values are applied on top of the default, so their settings are preserved as well as possible. The preset is now visible in the UI and the user can correct any values that used to derive from the missing parent.Behaviour change
Notes
The fallback may produce subtly different values for settings that were inherited (not explicitly saved) from the missing parent. This is a known trade-off: a preset with potentially imperfect settings is always preferable to a silently deleted preset.