From d709c04f577386b9da6e3272240726454e341275 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 21 May 2026 08:12:45 -0400 Subject: [PATCH] Bug 42664: Update SIP2 config timestamp after storing the change Koha::SIP2::Object::store bumps the timestamp before SUPER::store, opening a race condition where a worker reloading during db update transaction caches a config that is missing the new row. Bump the timestamp after the row has been written so it is not advanced ahead of the data it represents. Test Plan: 1) prove t/db_dependent/Koha/SIP2/SIP2ModuleMigration.t 2) prove t/db_dependent/api/v1/sip2_accounts.t Signed-off-by: Brendan Lawlor Signed-off-by: Pedro Amorim --- Koha/SIP2/Object.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/SIP2/Object.pm b/Koha/SIP2/Object.pm index 6555785d72..ec38b0acef 100644 --- a/Koha/SIP2/Object.pm +++ b/Koha/SIP2/Object.pm @@ -46,8 +46,9 @@ This is the base class for SIP2 objects in the Koha library system. sub store { my ($self) = @_; + my $result = $self->SUPER::store; _update_config_timestamp(); - return $self->SUPER::store; + return $result; } =head3 delete @@ -59,8 +60,9 @@ sub store { sub delete { my ($self) = @_; + my $result = $self->SUPER::delete; _update_config_timestamp(); - return $self->SUPER::delete; + return $result; } =head3 _update_config_timestamp