andk / pause

Perl authors upload server
http://pause.perl.org/
150 stars 57 forks source link

Delete-Files doesn't list files in the right order, if some releases used "v" in the version #427

Open neilb opened 1 year ago

neilb commented 1 year ago

If an author uses "v" in the version of their distribution, for some releases, then when you go to Delete Files, the files aren't listed in the right order.

Here's an example. The author started off using vanilla release numbers, then used "v" notation for a while (boo), and then dropped the "v" (yay):

plosuring-delete-files

The 0.2 and 0.3 files should appear at the end of the list, but they're in the middle.

Grinnz commented 1 year ago

I expect this is a simple asciibetical filename sort so it looks expected to me. To sort the way suggested could be done via an extracted "distribution version" and sorting that column using version.pm or the numified form, except that such a concept doesn't exist in PAUSE - but using https://metacpan.org/pod/CPAN::DistnameInfo or similar process to extract the filename version would probably be good enough.

charsbar commented 4 months ago

Note: I implmented this in my local virtual machine. I dropped the current js sorter and sorted files on the serverside using new query parameters (sort_by and sort_order). It worked, until I pretended to be someone else. When I click a link to sort as someone else, pretension is gone. Adding parameters to pretend to the links to sort is bad. Maybe I need to fix how to pretend before I revisit this.

ap commented 4 months ago

Adding parameters to pretend to the links to sort is bad.

FTFY 😉

In our application at $work, pretending to be someone else is done in the cookie. The user_id field of the cookie changes to the ID of the user you are pretending to be, and a real_id field is added with the ID of who you originally logged in as. If you log out while there is a real_id value in your cookie, you do not actually get logged out, it just swaps the value of real_id back into user_id and clears real_id. It is more or less like EUID/UID in Unix.