Fix database import, pagination and counters on user profile page
Created by: Tirokk
Authored by roschaefer Merged
Ok, so here are multiple issues:
-
In cypher,
NOT NULLwill returnNULLnotFALSE. If we wantFALSEto be set in the database import, we should useCOAELESCEto find the first not-null value. See: https://neo4j.com/docs/cypher-manual/current/syntax/working-with-null/ https://markhneedham.com/blog/2017/02/22/neo4j-null-values-even-work/ -
I removed the
disabledanddeletedchecks on the commented counter. Withneo4j-graphql-jsit is not possible to filter on the join models (at least not without a lot of complexity) for disabled or deleted items. Let's live with the fact that the list of commented posts will include those posts, where the user has deleted his comment or where the user's comment was disabled. It's being displayed as "not available" so I think this is OK for now. -
De-couple the pagination counters from the "commented", "shouted" etc. counters. It might be that the list of posts is different for different users. E.g. if the user has blocked you, the "posts" list will be empty. The "shouted" or "commented" list will not have the posts of the author. If you are a moderator, the list will include disabled posts. So the counters are not in sync with the actual list coming from the backend. Therefore I implemented "fetch and check if resultSet < pageSize" instead of a global counter.
🍰 Pullrequest
Issues
- fix #1333 (closed)
Todo
-
None