Created by: CristinaBirkel
Closes #29576 (closed)
I believe there were a few issues here:
LIMIT
clause in the query was limiting results before filtering by permissions. This resulted in fewer results than expected, depending on ordering and permissions.LIMIT
clause to the end was that this query is returning insight_series
, not insight_views
, so it would have limited the wrong thing there as well. So what I did was to first select insight_views
, and then join with the other tables necessary to return all the columns we wanted.pageInfo
wasn't working well for the last page because it returned a cursor whenever there were results.GroupByView
was ordering by id instead of unique_id as well, which needs to be consistent for this to work.Ideally I would like to refactor this more, but given the scope of the bug as I did what felt like the minimum viable change.
GetAll
which focus on paginationLet me know if you see anything unexpected! I am a bit concerned modifying this complex query, but it all seems to be working from what I tested.