So, browsing Lemmy.world today, I’ve noticed a green box show up a couple times in the lower left corner that says “Report Created”. Any idea what that’s about?

  • Slashzero@hakbox.social
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    Yup – that’s been reported too. It’s not a great look. I’ve been looking at the up/down vote functionality, and it is literally triggering an INSERT to the DB every single time you click either button.

    • Kushan@beehaw.org
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Is that because of some kind of event sourcing, though? That’s not an uncommon way of handling these things.

      • Slashzero@hakbox.social
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        1 year ago

        Yes, of course it makes sense to do it that way. The issue is you can literally click the up arrow repeatedly as fast as you can and create some database load.

        Usually, at least from my experience, it is good practice to put some logic client-side to prevent a user from repeatedly clicking a button accidentally (or on purpose – hey, why did I get a double post?!). Even a quarter second delay can help.

        • Kushan@beehaw.org
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          Yeah, that kind of abuse prevention really shouldn’t be client side at all. It’s one thing to prevent a user accidentally causing harm, but if a bad actor can deliberately do it then we’ve got bigger problems.