From e0fccacc32d73fb6d41dc2a7af075218fad70e76 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 27 Aug 2025 23:05:00 +0200 Subject: [PATCH] fix: Nightlies always having an update available, even if we're already on latest --- lib/libimhex/source/api/imhex_api.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libimhex/source/api/imhex_api.cpp b/lib/libimhex/source/api/imhex_api.cpp index 04670f585..203b7ecd4 100644 --- a/lib/libimhex/source/api/imhex_api.cpp +++ b/lib/libimhex/source/api/imhex_api.cpp @@ -979,7 +979,13 @@ namespace hex { const auto nightlyUpdateTime = hex::parseTime("%Y-%m-%dT%H:%M:%SZ", firstAsset["updated_at"].get()); const auto imhexBuildTime = ImHexApi::System::getBuildTime(); - if (nightlyUpdateTime.has_value() && imhexBuildTime.has_value() && *nightlyUpdateTime > *imhexBuildTime) { + + // Give a bit of time leniency for the update time check + // We're comparing here the binary build time to the release upload time. If we were to strictly compare + // upload time to be greater than current build time, the check would always be true since the CI + // takes a few minutes after the build to actually upload the artifact. + // TODO: Is there maybe a better way to handle this without downloading the artifact just to check the build time? + if (nightlyUpdateTime.has_value() && imhexBuildTime.has_value() && *nightlyUpdateTime > *imhexBuildTime + std::chrono::hours(1)) { return "Nightly"; } } else {