Skip to content
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

Child reactions of child reactions do not get updated properly #304

Open
arnautov-anton opened this issue Sep 24, 2021 · 10 comments
Open

Child reactions of child reactions do not get updated properly #304

arnautov-anton opened this issue Sep 24, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@arnautov-anton
Copy link
Collaborator

When user creates a reply comment to a parent reaction and then right after tries to create another child reaction to that newly created child reaction (of kind like in this instance) - the own_children key (and basically other keys also) of that object won't get updated properly. The application crashes while trying to find path with FeedManager.getReactionPaths which returns undefined in FeedManager.onToggleChildReaction or later in FeedManager.onAddChildReaction.

Screen.Recording.2021-09-24.at.12.22.02.PM.mov
@arnautov-anton arnautov-anton added the bug Something isn't working label Sep 24, 2021
@arnautov-anton arnautov-anton self-assigned this Sep 24, 2021
@antishok
Copy link

Hi, we're seeing the same, or a very similar issue.
When replying to a comment, FeedManager.getReactionPaths is called on an activity param which is actually the comment object (the comment to which we're replying) and returns undefined, causing an error.
Any updates on this? Thanks

@antishok
Copy link

In case it helps, this is the gist of what we're doing:

<CommentList
  activityId={someActivityId}
  CommentItem={(comment_props) => (
    ...
    <CommentField activity={comment_props.comment} />
  )}
/>

@arnautov-anton
Copy link
Collaborator Author

Hey, @antishok! Sadly, no update yet, but the reply functionality (activity -> comment -> reply comment) is unaffected by this. It's the children of reply comments (likes or other sub-reply comments) that cause this issue, which is also a maximal nesting depth allowed by the BE.

@antishok
Copy link

Thanks for the reply @arnautov-anton.
That's odd then because we are having this issue with just replies to comments (to activities),
but maybe we are doing something wrong on our end.

Can you please confirm that the usage I showed above is correct?
Specifically this part: <CommentField activity={comment_props.comment} />
Is it correct to pass the comment object as the activity to CommentField?
The documentation has almost no info on how to properly do replies to comments.

Thanks again!

@arnautov-anton
Copy link
Collaborator Author

Sure! Here's a simple example I've been using for testing - works fine without the likes on the replies. Yours seems to be pretty close to how it's used normally but feel free to try it out and let me know if you're still experiencing the issues.

Also I'm sorry about the missing documentation - we're currently working on it and we plan to release it as soon as it's finished. Sorry for the inconvenience.

@antishok
Copy link

antishok commented Dec 23, 2021

Thanks for the example.
But it seems pretty different, you are not using CommentField (for the replies), but using useFeedContext and onAddChildReaction - what are those? Are they documented somewhere?

@antishok
Copy link

Figured it out - and your method indeed seems to work, so thanks a lot.
Unfortunately it requires re-implementing the CommentField component, and using undocumented API's :)

@antishok
Copy link

I've modified CommentField to work with comment replies,
I'll share it here in case it's useful to someone: CommentReplyField.jsx

@arnautov-anton
Copy link
Collaborator Author

Hey again, @antishok! I missed your point at first but I understand now, I'll create a separate issue to extend current CommentField component to accept comment as well as activity object so it can be used with comment replies. Thank you for pointing this out and thank you for your contribution. 🙂

@DmitriyNikolenko
Copy link

Facing the same issue, when we "created comment -> replied to comment => liked comment reply - > error is thrown".
An error is thrown because FeedManager.getReactionPaths is 'undefined'. Only after a refresh of the SinglePost a user can like a reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants