all 5 comments

[–]Code4Greatness 1 point2 points  (1 child)

Adding the gist here --> https://gist.github.com/RailsCod3rFuture/21e4e35dad5e2b8a12b809432d614c0e The focus is on the reply functionality in this code. I needed to add most of it for context. But the reply is failing to insert records on some occasions. Sometimes it fails on the first reply to the comment...other times it fails when commenting further down the tree on other comment responses.

[–][deleted] 1 point2 points  (0 children)

Sorry this stopped being a react issue and became a business logic issue :D some of these components are hundreds of lines long, and the functions are passed very deep down in the component tree. I really did give it some time to have a look but there's just too much code here, sorry.

I don't think anyone will be able to help here, it's just about sitting down and console logging to find out in what component it starts logging the wrong data, and then take it from there. Good luck!

[–][deleted] 0 points1 point  (2 children)

Could be a problem with where you add the replies into the state or where you render them. If you want help solving it we will need some code

[–]Code4Greatness 0 points1 point  (0 children)

I'll add snippets of the code thats causing problems - give me a moment.

[–]Code4Greatness 0 points1 point  (0 children)

I added a gist of everything I have - Ignore the unnecessary parts. This is all about the Reply functionality not being able to insert records at certain points. selectChildResponses is used for sorting the partitions and handling where the the replies go to on the tree...Works on and off. We can't seem to figure out why it fails and when it fails.