-
Notifications
You must be signed in to change notification settings - Fork 361
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
[CORL-3224]: ensure replies to rejected parent comments are not included in comment count #4757
base: develop
Are you sure you want to change the base?
[CORL-3224]: ensure replies to rejected parent comments are not included in comment count #4757
Conversation
…g a rejected parent
✅ Deploy Preview for gallant-galileo-14878c canceled.
|
@@ -645,13 +645,6 @@ const enhanced = withPaginationContainer< | |||
} | |||
mode | |||
} | |||
commentCounts { |
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.
Removed this since it doesn't seem to be used...
…ithub.com:coralproject/talk into fix/CORL-3224-replies-hidden-parent-comment-count
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.
Tested and approved!
This all appears very consistent with the existing counts logic we have in Coral currently. The graphLookUp
being done only during the approve
and reject
steps looks good as well!
Nice work!
What does this PR do?
These changes ensure that when replies in the stream have rejected ancestor comments, they are not included in the comment count shown since they are not visible. The changes use
totalPublishedAndVisible
for the stream now. A newrejectedAncestorIDs
on comments is used to keep track of whether a comment has any rejected ancestors and is therefore hidden. A newPUBLISHED_COMMENTS_WITH_REJECTED_ANCESTORS
has been added to counts to keep track of these in a count that can then be used to determine the newtotalPublishedAndVisible
.Having
rejectedAncestorIDs
on comments may be useful to us in other places too. For example, currently, we have ahasRejectedAncestors
function inserver/src/core/server/services/comments/comments.ts
. We could refactor this to utilize the newrejectedAncestorIDs
.These changes will impact:
What changes to the GraphQL/Database Schema does this PR introduce?
To GraphQL, these changes add
rejectedAncestorIDs
. Also, to comment counts,totalPublishedAndVisible
andrelationships: {PUBLISHED_COMMENTS_WITH_REJECTED_ANCESTORS: number}
.To database schema,
rejectedAncestorIDs
has been added to comments. Also, to comment counts,relationships: {PUBLISHED_COMMENTS_WITH_REJECTED_ANCESTORS: number}
has been added.Does this PR introduce any new environment variables or feature flags?
no
If any indexes were added, were they added to
INDEXES.md
?TODO: Confirm if any new indexes are needed
How do I test this PR?
You can test these changes by testing that comment counts are still working as expected.
Also, create a bunch of comments in the stream. Include levels of replies. Reject and approve comments and replies at all different levels. Reject and approve replies to already rejected ancestors. See that the stream's comment count updates according to how many comments are actually visible in the stream.
Were any tests migrated to React Testing Library?
no
How do we deploy this PR?