thelastWallE / OctoprintKlipperPlugin

A plugin for a better integration of Klipper into OctoPrint.
GNU Affero General Public License v3.0
65 stars 14 forks source link

Konfiguration editor does not reload after SAVE_CONFIG command #16

Closed ohumi closed 3 years ago

ohumi commented 3 years ago

Before submitting your issue please make sure to provide the following information

About your environment:

Thanks

AliceGrey commented 3 years ago

@ohumi Could you provide more details of the error? Steps to re-create and a log file?

TheNitek commented 3 years ago

I got the same problem: I do a DELTA_CALIBRATE and SAVE_CONFIG afterwards. Locking at the config using SSH I can see the new config values. Looking at the config using OctoKlippers web editor, I still see the old configuration.

gufi commented 3 years ago

a temporary workaround is to ensure that you hard refresh the entire octoprint ui. then go back in and new settings that were generated will be there. This is likely due to some kind of browser caching or something

ururk commented 3 years ago

Just came here to report this bug and can confirm the behavior. I was using the PROBE_CALIBRATE routine, and after doing SAVE_CONFIG, went to this plugin's page and my new configuration was not visible - refreshed OctoPrint and the configuration appeared.

The first time this happened I lost my probe settings, as I had ran PROBE_CALIBRATE, then updated a different config setting, all without reloading the page. If you don't reload the page, it will overwrite your existing config even if it has changed on disk while OctoPrint was running.

ururk commented 3 years ago

It feels like it should read the config anytime the plugin is invoked (not sure what the programming flow is for OctoPrint plugins, and if you have to deal with caching on your end).

gufi commented 3 years ago

from what i can tell configs are loaded once since all plugins have their state held on the browser until refresh. There probably needs to be a little work between both Octo and plugin creators to allow a different behavior for plugins that can modify their settings externally without a browser

jangrewe commented 3 years ago

I wouldn't call it a bug, but more of a feature request: either reload the config from disk when accessing that tab, or provide a button to manually reload the config - the later probably being the safe choice, so that users don't loose their manually typed in configuration just because they're switching tabs.

But yes, please add some kind of functionality to reload the config without having to reload the whole page! 🙂

thelastWallE commented 3 years ago

Just an update on this. I have it almost ready, but i wanted to implement this along with the ace editor. The editor would reload the file from disk as the settings dialog is opened.