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 <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Kyle M Hall 2026-05-21 08:12:45 -04:00 committed by Pedro Amorim
parent f899761666
commit d709c04f57
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 4 additions and 2 deletions

View File

@ -46,8 +46,9 @@ This is the base class for SIP2 objects in the Koha library system.
sub store { sub store {
my ($self) = @_; my ($self) = @_;
my $result = $self->SUPER::store;
_update_config_timestamp(); _update_config_timestamp();
return $self->SUPER::store; return $result;
} }
=head3 delete =head3 delete
@ -59,8 +60,9 @@ sub store {
sub delete { sub delete {
my ($self) = @_; my ($self) = @_;
my $result = $self->SUPER::delete;
_update_config_timestamp(); _update_config_timestamp();
return $self->SUPER::delete; return $result;
} }
=head3 _update_config_timestamp =head3 _update_config_timestamp