Tag list sort order lost on tag delete operation

Summary

On the tag management page, .../-/tags, a user selected sort order is lost when deleting a tag.

Steps to reproduce

  1. navigate to tag list page, ie https://gitlab.com/qayshp/gitlab/-/tags
  2. select a sort order, ie "Oldest updated"
  3. note that the sort order is a part of the HTTP get request URL for the page, ie https://gitlab.com/qayshp/gitlab/-/tags?sort=updated_asc
  4. delete a tag, ie click the trash icon and then confirm on modal with "Yes, delete tag"
  5. after a short delay, during which the browser has sent the HTTP delete post request, the server responds with a 303 redirect
  6. URL in 303 response header is missing the sort order, and the browser then shows the tag list page in default order, ie https://gitlab.com/qayshp/gitlab/-/tags as from step 1

Example Project

Example project I used is my fork of this gitlab project. Links are above, but obviously you can only replicate if your user has authorization to delete tags.

What is the current bug behavior?

Sort order is lost from the list page for tags after performing a delete action.

What is the expected correct behavior?

Sort order to be consistent, to what it was before the delete, after a delete. For example, the branch list page .../-/branches?state=all does retain sort order in the 303 redirect URL header.

Relevant logs and/or screenshots

I will happily provide if requested, but this seems like overkill for the bug.

Output of checks

This bug happens on GitLab.com

Possible fixes

Currently unable to dig in, sorry.

Implementation Plan

Root Cause: In app/controllers/projects/tags_controller.rb, the destroy action redirects to project_tags_path(@project) without preserving query params.

Solution: Modify the redirect to preserve the sort parameter.

Acceptance Criteria

  • The sort option is preserved when deleting a tag
  • No change in tag deletion functionality
Edited by 🤖 GitLab Bot 🤖