loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Perform Newest sort type correctly when sorting issues (#30644)

Should resolve #30642.

Before this commit, we were treating an empty `?sort=` query parameter
as the correct sorting type (which is to sort issues in descending order
by their created UNIX time). But when we perform `sort=latest`, we did
not include this as a type so we would sort by the most recently updated
when reaching the `default` switch statement block.

This commit fixes this by considering the empty string, "latest", and
just any other string that is not mentioned in the switch statement as
sorting by newest.

(cherry picked from commit 9b7af4340c36d3e1888788499d16f83feeb1601b)

authored by

Kemal Zebari and committed by
Earl Warren
50917ead 39faa125

+2 -2
+2 -2
modules/indexer/issues/dboptions.go
··· 68 68 searchOpt.Paginator = opts.Paginator 69 69 70 70 switch opts.SortType { 71 - case "": 71 + case "", "latest": 72 72 searchOpt.SortBy = SortByCreatedDesc 73 73 case "oldest": 74 74 searchOpt.SortBy = SortByCreatedAsc ··· 86 86 searchOpt.SortBy = SortByDeadlineDesc 87 87 case "priority", "priorityrepo", "project-column-sorting": 88 88 // Unsupported sort type for search 89 - searchOpt.SortBy = SortByUpdatedDesc 89 + fallthrough 90 90 default: 91 91 searchOpt.SortBy = SortByUpdatedDesc 92 92 }