From 6b70d53518b64f34271cc312d1af0f1371fd52be Mon Sep 17 00:00:00 2001 From: Tom Kimsey Date: Wed, 20 Dec 2023 13:57:22 -0500 Subject: [PATCH] Fixed bug where config files could not be updated The bug was caused by the ConfigFileUpdater class not being able to update config file that version was higher than the target version of the beginning steps in the update process. The updater would incorrectly indicate failure when the update step was for a older config file version. --- .../americas/sc/extensions/config/ConfigFileUpdater.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java b/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java index c0f44f2f..e81defab 100644 --- a/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java +++ b/src/main/java/com/hms_networks/americas/sc/extensions/config/ConfigFileUpdater.java @@ -160,14 +160,16 @@ public boolean updateConfig() { for (int i = 0; i < steps.size(); i++) { ConfigFileUpdateStep step = (ConfigFileUpdateStep) steps.get(i); - if (success && step.isCompatibleWithVersion(getConfigFileVersion())) { - success = success && step.updateConfig(config); + if (step.isCompatibleWithVersion(getConfigFileVersion())) { + success = step.updateConfig(config); if (success) { success = setConfigFileVersion(step.getStepVersion()); + } else { + // The step is compatible with the current version, but failed to update the config + break; } } else { success = false; - break; } }