From b4b028be3a58775073075fcf1296852fbf67cec2 Mon Sep 17 00:00:00 2001 From: Dave Allie Date: Mon, 9 Feb 2026 08:08:19 +1100 Subject: [PATCH] fix: Allow OTA update from RC build to full release (#778) ## Summary * Allow OTA update from RC build to full release * If all the segments match, then also check if the current version contains "-rc" --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? No --- src/network/OtaUpdater.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/network/OtaUpdater.cpp b/src/network/OtaUpdater.cpp index 1733e136..3c2dda8a 100644 --- a/src/network/OtaUpdater.cpp +++ b/src/network/OtaUpdater.cpp @@ -185,7 +185,16 @@ bool OtaUpdater::isUpdateNewer() const { /* * Check patch versions. */ - return latestPatch > currentPatch; + if (latestPatch != currentPatch) return latestPatch > currentPatch; + + // If we reach here, it means all segments are equal. + // One final check, if we're on an RC build (contains "-rc"), we should consider the latest version as newer even if + // the segments are equal, since RC builds are pre-release versions. + if (strstr(currentVersion, "-rc") != nullptr) { + return true; + } + + return false; } const std::string& OtaUpdater::getLatestVersion() const { return latestVersion; }