Sorting users by Last Sign-In results in nonsense ordering #8016

Closed
opened 2025-11-02 07:51:01 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @laurivosandi on GitHub (Oct 24, 2021).

Gitea Version

1.15.5

Git Version

Not relevant

Operating System

Docker image

How are you running Gitea?

I am using gitea/gitea:1.15 tag and I am currently running 1.15.5

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Sorting by Last Sign-in under /admin/users results in nonsense ordering. Cannot reproduce on Gitea demo site because site administration is not available for me there.

Screenshots

Screenshot from 2021-10-24 17-11-11

Originally created by @laurivosandi on GitHub (Oct 24, 2021). ### Gitea Version 1.15.5 ### Git Version Not relevant ### Operating System Docker image ### How are you running Gitea? I am using `gitea/gitea:1.15` tag and I am currently running 1.15.5 ### Database MySQL ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description Sorting by Last Sign-in under `/admin/users` results in nonsense ordering. Cannot reproduce on Gitea demo site because site administration is not available for me there. ### Screenshots ![Screenshot from 2021-10-24 17-11-11](https://user-images.githubusercontent.com/194685/138598147-896595e0-bd03-469f-ae82-dbc7e5e92eb3.png)
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 07:51:01 -06:00
Author
Owner

@laurivosandi commented on GitHub (Oct 24, 2021):

Also while at it: please make it easy to inspect more accurate timestamp, eg via tooltip

@laurivosandi commented on GitHub (Oct 24, 2021): Also while at it: please make it easy to inspect more accurate timestamp, eg via tooltip
Author
Owner

@dvejmz commented on GitHub (Oct 24, 2021):

I can reproduce the Last Sign-in column sorting issue in 1.15.5 (Docker / SQLite3)

localhost_3001_admin_users_sort=leastupdate q= (1)

However, I cannot reproduce in 1.16 (Local binary compiled from main / SQLite3), which makes me think the issue was fixed some time ago but no stable releases are available yet with the fix?

localhost_3000_admin_users_sort=leastupdate

Longer timestamps are available as a tooltip for me in both versions when I hover over the sign-in field for a couple of seconds. If this doesn't work for you, perhaps try on a different browser @laurivosandi ? This works for me on Chrome.

@dvejmz commented on GitHub (Oct 24, 2021): I can reproduce the Last Sign-in column sorting issue in `1.15.5` (Docker / SQLite3) ![localhost_3001_admin_users_sort=leastupdate q= (1)](https://user-images.githubusercontent.com/9487006/138601451-36b33aa9-3bfa-4bb0-b4e2-8602b279b6ec.png) However, I cannot reproduce in `1.16` (Local binary compiled from `main` / SQLite3), which makes me think the issue was fixed some time ago but no stable releases are available yet with the fix? ![localhost_3000_admin_users_sort=leastupdate](https://user-images.githubusercontent.com/9487006/138601521-c968da77-3a09-4e36-91ef-60400af96890.png) Longer timestamps are available as a tooltip for me in both versions when I hover over the sign-in field for a couple of seconds. If this doesn't work for you, perhaps try on a different browser @laurivosandi ? This works for me on Chrome.
Author
Owner

@wxiaoguang commented on GitHub (Oct 24, 2021):

It seems to be related with a very old logic, https://github.com/go-gitea/gitea/pull/7980

  <th data-sortt-asc="recentupdate" data-sortt-desc="leastupdate">
    {{.i18n.Tr "admin.users.last_login"}}
    {{SortArrow "recentupdate" "leastupdate" $.SortType false}}
  </th>

It uses the update time column to sort for the last login field. Maybe we need a fix for it.

@wxiaoguang commented on GitHub (Oct 24, 2021): It seems to be related with a very old logic, https://github.com/go-gitea/gitea/pull/7980 ``` <th data-sortt-asc="recentupdate" data-sortt-desc="leastupdate"> {{.i18n.Tr "admin.users.last_login"}} {{SortArrow "recentupdate" "leastupdate" $.SortType false}} </th> ``` It uses the `update time` column to sort for the `last login` field. Maybe we need a fix for it.
Author
Owner

@noerw commented on GitHub (Oct 24, 2021):

duplicate of #14942

@noerw commented on GitHub (Oct 24, 2021): duplicate of #14942
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8016