Code Monkey home page Code Monkey logo

Comments (2)

ottodevs avatar ottodevs commented on July 21, 2024

The problem is harder than I thought.

I initially thought it only was a CSS problem, but when I went deeper into the code I discovered a serious bug.

image

In my screenshot all sub-replies are actually nested within each other, but they are perfectly aligned in the 3rd level, so I would say the issue was fixed, but actually didn't make any changes...

The real problem is that all the sub-replies in my screenshot, were created without refreshing the page, so in the database they all were assigned as the 2nd level reply sub-replies, that is why they appear aligned. The field that is causing the problem is "replicable_id"

When I refresh the page and try to make, for example, another 4th level sub-reply to the 3rd level reply, then it goes to the right place and gets aligned correctly, with the 4th level indentation.

So this error must be fixed before trying to mess with nesting levels, because it could affect the actual stored data, as some sub-replies in the forum, may be currently pointing to wrong parent replies.

from spacedecentral-network.

ottodevs avatar ottodevs commented on July 21, 2024

I have reviewed every single reply in the forum and it seems the bug didn't affect any existent data, so there is no need to fix the current production database, I fixed the affected code and added some conditional css rules for 3rd level and higher replies, this was a UI, just visual issue, we should never alter the data to change things like this issue.

I also tried to assess if integrating a nested tree gem like ancestry would worth the effort, probably it will be useful to improve data structure and performance, but it may involve so many critical changes in the database structure so I think for the moment the changes proposed in my pull request just fix the problem without messing with sensitive areas of the code.

from spacedecentral-network.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.