From 47c722846ece5eb460d91c243e4358eb31e4614b Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 May 2020 22:14:58 -0700 Subject: Sort ACL history by unique key after date If multiple ACL changes were made in the same second, the order of results could be unstable. Sort by unique key after date to avoid this. Based on work by macrotex. --- perl/lib/Wallet/ACL.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl/lib/Wallet/ACL.pm b/perl/lib/Wallet/ACL.pm index 58e33b4..5b949e9 100644 --- a/perl/lib/Wallet/ACL.pm +++ b/perl/lib/Wallet/ACL.pm @@ -1,7 +1,7 @@ # Wallet::ACL -- Implementation of ACLs in the wallet system # # Written by Russ Allbery -# Copyright 2016 Russ Allbery +# Copyright 2016, 2020 Russ Allbery # Copyright 2007-2008, 2010, 2013-2015 # The Board of Trustees of the Leland Stanford Junior University # @@ -438,7 +438,7 @@ sub history { eval { my $guard = $self->{schema}->txn_scope_guard; my %search = (ah_acl => $self->{id}); - my %options = (order_by => 'ah_on'); + my %options = (order_by => { -asc => [qw/ah_on ah_id/] }); my @data = $self->{schema}->resultset('AclHistory') ->search (\%search, \%options); for my $data (@data) { -- cgit v1.2.3