codechecker
codechecker copied to clipboard
[web] Sorting is not saved on the Reports view when returning from a bug's details
Describe the bug
When changing the sorting of the report list and then opening a bug and then returning to the bug list, the sorting information is lost.
CodeChecker version
6.21 stable (official PyPI) release
To Reproduce
- Open the following URL that is a filtered view of some bugs: https://codechecker-demo.eastus.cloudapp.azure.com/Default/reports?review-status=Unreviewed&review-status=Confirmed%20bug&detection-status=New&detection-status=Reopened&detection-status=Unresolved&run=%2ataint_improvement_fixed&is-unique=off&diff-type=New&checker-msg=%2auntrusted%2a&checker-msg=%2ataint%2a&sort-by=bugPathLength&sort-asc=true&sort-desc=true
- By default, this view is sorted with the longest bugs first, aka
sort-desc=true. - Click on the column header for "Bug path length" and see that it sorts as ascending (shortest bug path first, which I want to view)
- The URL changes to https://codechecker-demo.eastus.cloudapp.azure.com/Default/reports?review-status=Unreviewed&review-status=Confirmed%20bug&detection-status=New&detection-status=Reopened&detection-status=Unresolved&run=%2ataint_improvement_fixed&is-unique=off&diff-type=New&checker-msg=%2auntrusted%2a&checker-msg=%2ataint%2a&sort-by=bugPathLength&sort-asc=true&sort-desc=false, and now ends with
sort-desc=falseat the end - Open a bug, e.g., the first one in the list
- Now the bug URL (https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?review-status=Unreviewed&review-status=Confirmed%20bug&detection-status=New&detection-status=Reopened&detection-status=Unresolved&run=%2ataint_improvement_fixed&is-unique=off&diff-type=New&checker-msg=%2auntrusted%2a&checker-msg=%2ataint%2a&sort-by=bugPathLength&sort-asc=true&sort-desc=false&report-id=1356911&report-hash=7cafabdfa1aa3459cfee8da281bbea5a&report-filepath=%2Flocal%2Fpersistent_docker%2FCSA-measurements-driver-70%2Fmeasurements_workspace%2Ftmux%2Fstatus.c) changes again, and in the middle, it contains something like
sort-asc=true - Click the "Back to reports" button
- We return to https://codechecker-demo.eastus.cloudapp.azure.com/Default/reports?review-status=Unreviewed&review-status=Confirmed%20bug&detection-status=New&detection-status=Reopened&detection-status=Unresolved&run=%2ataint_improvement_fixed&is-unique=off&diff-type=New&checker-msg=%2auntrusted%2a&checker-msg=%2ataint%2a&sort-by=bugPathLength&sort-asc=true&sort-desc=true, where we have
sort-asc=true&sort-desc=truein the URL and now the longest bug is on the top, and I need to sort again.
Expected behaviour
Sorting preferences (just like the filters) are saved in the view appropriately, i.e., I get back seeing the shortest bug first.
Additional context
Likely the issue is that we append both sort-asc and sort-desc into the URL and either one of them (or the last one in the text?) takes priority.