New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix duplicate sort results #13387
Fix duplicate sort results #13387
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13387 +/- ##
==========================================
- Coverage 48.22% 48.20% -0.02%
==========================================
Files 239 239
Lines 8834 8837 +3
Branches 1992 1993 +1
==========================================
Hits 4260 4260
- Misses 3766 3768 +2
- Partials 808 809 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's breaking some e2e tests in packages/core/content-manager/server/tests/api/basic-relations.test.e2e.js
Hey based on our lastest discussion on the topic this isn't solving the problem at hand :) I'll close for now :) |
What does it do?
In query builder when we query for data and we have joins, we run
qb.distinct
which should remove duplicate data from the query but after some testing it doesn't seem to affect queries with multiple joins and duplicate data was queried when trying nested sorting. So I opted to useqb.groupBy
instead when we have multiple joins and sortingWhy is it needed?
When doing nested sorting, duplicate data is being returned
How to test it?
run a strapi application and create content types with a relation, try to sort the parent content type based on a relation field there should be no duplicates, you can follow the same method in the issue I will reference below.
Related issue(s)/PR(s)
fixes #11892