// save the state of this module for future restarts
saveGlobalProperty(moduleId + ".started", "true", ...);
What if the GP moduleId + ".started" already exists and is already set to be false? ModuleFactory#startModuleInternal would just override it to be true without asking…
In one of our CI envs we anticipate that a certain module will be there and we want to disable it in advance under certain circumstances by toggling the GP to false (even before it’s ever created by Core.)
it’s not what I noticed in our deployment process:
before starting OpenMRS, a script deactivates the plugin with UPDATE global_property gp SET property_value = 'false' WHERE property = 'oauth2login.started';. It’s a script included in our Docker image.
FYI, the module is included as a bundle. Maybe it changes some order in the initalisation process
The module is started despite the property oauth2login.started set to false
I restart OpenMRS ( a docker-compose restart) and the module is deactivated
I will try to check it again but as I run the exact same scripts I believe that, at the first time, the property is resetted somewhere.
Ok I found my issue: SQL.
UPDATE global_property gp SET property_value = 'false' WHERE property = 'oauth2login.started'; will do nothing if the property is not present.