Coder Social home page Coder Social logo

Found bug about website HOT 3 CLOSED

delbaoliveira avatar delbaoliveira commented on July 26, 2024
Found bug

from website.

Comments (3)

delbaoliveira avatar delbaoliveira commented on July 26, 2024

Hey!

No worries, feel free to post it here. I think I know what you're talking about, it's a race condition bug when someone rapidly likes the button for the first time.

I can possibly solve it by debouncing in useSWR. However, I'm going to move DBs soon and will probably solve it then.

If you have more insight, would love to hear it. :)

from website.

theodorusclarence avatar theodorusclarence commented on July 26, 2024

https://github.com/delbaoliveira/website/blob/main/pages/api/likes/%5Bid%5D.ts#L55

Its in your likes api, you should constrain it to only 1-3 likes for now, and maybe if the likeByUser is already maxed out, you need to throw an error.

By accessing straight through API, I can basically add whatever amount to your likes, also decrement your likes.

I followed similiar structure as your like api, but using FaunaDB, maybe you want to check my repo out

Good luck! 🚀

from website.

theodorusclarence avatar theodorusclarence commented on July 26, 2024

delba

from website.

Related Issues (9)

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.