馃悰 [Bug] User profile page: Result set sizes !== pagination counts
Created by: Tirokk
Authored by roschaefer Closed
馃悰 Bugreport
@ulfgebhardt wrote us in Discord:
Es werden 4 Kommentiert angezeigt, aber die Liste enth盲lt 6 Eintr盲ge https://nitro-production.human-connection.org/profile/5acfe2083f62d4000b5b423c/dornhoeschen
The displayed counts of authored posts, commented posts and shouted posts are not the same as the actual number of results for the respective queries
Steps to reproduce the behavior
- Login at https://nitro-production.human-connection.org/
- https://nitro-production.human-connection.org/profile/5acfe2083f62d4000b5b423c/dornhoeschen
- Click on "commented"
- Displayed number of results and actual number of results differ
Expected behavior
Additional context
The root of the problem is that we use the counts on the User
type like:
https://github.com/Human-Connection/Human-Connection/blob/master/backend/src/schema/types/type/User.gql#L58
as pagination limit. See here:
https://github.com/Human-Connection/Human-Connection/blob/master/webapp/pages/profile/_id/_slug.vue#L306
But the filtered list of results might differ from that. Especially after we implemented #1209 the lists will vary per user who is looking at the profile page.
Therefore it is less buggy to use a pagination limit like "fetch and see if result.length < pageSize" instead of a total limit. Of course a correct total for any query would be the perfect solution but neo4j-graphql-js
does not support this. Example code:
https://github.com/Human-Connection/Human-Connection/blob/master/webapp/pages/index.vue#L173