Skip to content

Move autosave data into printer.autosave.cfg#787

Open
kageurufu wants to merge 2 commits intomainfrom
separate_autosave_cfg
Open

Move autosave data into printer.autosave.cfg#787
kageurufu wants to merge 2 commits intomainfrom
separate_autosave_cfg

Conversation

@kageurufu
Copy link
Member

Move autosave data from printer.cfg to printer.autosave.cfg

This no longer edits the user configuration commenting out duplicate options. Options in printer.autosave.cfg take priority over printer.cfg.

An automatic migration will take place the first SAVE_CONFIG after updating.

Thanks to @jwueller for the original implementation, I rewrote this as we decided to just bite the bullet and do everything at once. This superscedes #499

Checklist

  • pr title makes sense
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

This no longer edits the user's configuration to comment out changes to
configuration, and will automatically migrate legacy autosave data to
the new .autosave.cfg file

Autosave configuration takes priority over matching options in user
configuration.
@gitdacat
Copy link

I saw in your implementation the original config in printer.cfg is not commented out.
This can be confusing when I want to change a config, edit printer.cfg, and found out there is no effect because it have been overridden.

@jwueller
Copy link

jwueller commented Dec 28, 2025

I didn't take a close look at it, but if my contribution is still used to some degree, I'd appreciate adding me as a co-author to the relevant commit(s):

Co-authored-by: Johannes Wüller <johanneswueller@gmail.com>

I'll leave judging whether that's appropriate to you, though! I'm glad this feature might finally make it in. I think it got stuck before because we couldn't quite figure out how to go about rolling it out.

Edit: @gitdacat Yes, I think commenting out the replaced options is important. It would lead to hard-to-debug behavior otherwise. Note that my version prioritizes user settings over autosaved ones, to ensure that it has predictable behavior. Hidden settings overriding explicit settings is a recipe for confusion.

@dalegaard
Copy link
Contributor

I think auto-commenting should be removed, and instead the user can be told with a warning that they have specified a value and a different value is currently saved in autosave. Over time, we should move towards there existing no options that the user would want to both set manually and set with autosave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants