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
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user