Fix fuota device timeout filter.

We should filter on error_msg = "" instead of != NULL, as we only would
like to update the error_msg for devices that not yet have an error set.
Else we would overwrite an earlier error message.
This commit is contained in:
Orne Brocaar 2025-03-13 11:39:45 +00:00
parent 351406c363
commit 60547ff973

View File

@ -441,7 +441,7 @@ pub async fn set_device_timeout_error(
let mut q = diesel::update(fuota_deployment_device::table)
.set(fuota_deployment_device::dsl::error_msg.eq(&error_msg))
.filter(fuota_deployment_device::dsl::fuota_deployment_id.eq(&fuota_deployment_id))
.filter(fuota_deployment_device::dsl::error_msg.is_not_null())
.filter(fuota_deployment_device::dsl::error_msg.eq(""))
.into_boxed();
if mc_group_setup_timeout {