From 5dae81d3361f0577f397698616c8ab2f0e2569c4 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sun, 27 Aug 2023 15:20:40 -0700 Subject: [PATCH] Sort by start_time in beta mode only, to fix failing tests caused by changing the sorting --- client/lib/lib.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/lib/lib.go b/client/lib/lib.go index c8c1c2b..746ab01 100644 --- a/client/lib/lib.go +++ b/client/lib/lib.go @@ -1182,7 +1182,11 @@ func Search(ctx *context.Context, db *gorm.DB, query string, limit int) ([]*data if err != nil { return nil, err } - tx = tx.Order("start_time DESC") + if hctx.GetConf(ctx).BetaMode { + tx = tx.Order("start_time DESC") + } else { + tx = tx.Order("end_time DESC") + } if limit > 0 { tx = tx.Limit(limit) }