Innitial implementation of nested comments/replies - #125
Open
RomanKholod wants to merge 1 commit into
Open
Conversation
Contributor
|
DrFaust555
requested changes
Aug 23, 2026
DrFaust555
left a comment
Contributor
There was a problem hiding this comment.
In practice, this PR should be closed as an outdated duplicate, and not refined.
Notes
- The functionality is already implemented in merged PR #121.
PR #121 contains replies, moderation, migration, full tree construction and broader tests. In the comment to #125, it was already requested to be closed due to duplication. Now the PR conflicts with dev. - There is no migration for ParentCommentId.
The field is added to Comment, but the migration and model snapshot are not updated. The column and self-FK will not appear in the existing DB. The corresponding migration is present in #121. - Reply can be tied to a comment of another Streetcode.
The Handler only checks the existence of parent, but not parentComment.StreetcodeId == command.Comment.StreetcodeId (code). As a result, the reply will be displayed in the wrong thread or will be lost altogether. - GET actually supports only one level of nesting.
The request uses only .Include(c => c.Replies) and does not load the next levels (handler). At the same time, the API allows you to respond to a reply, so the third and subsequent levels are created, but not returned. - The author of the reply can be returned as Unknown User.
There is no ThenInclude(r => r.User) for Replies, and the mapper substitutes Unknown User if User is missing. Since the repository uses AsNoTracking, automatic relationship fix-up will not fix this. - The tests do not pass.
Result: 318 passed, 1 failed. A new Handle_ReturnsSuccess_WhenReplyIsValid is thrown: ParentCommentId == 1 is expected, actually null (assert).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.