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

[Bug]: 快速点击 like 导致数据异常 || [Bug]: Clicking like quickly causes data anomaly #2626

Closed
Raincarnator opened this issue Jul 20, 2024 · 1 comment
Labels
discussion Question or dicussion

Comments

@Raincarnator
Copy link

Raincarnator commented Jul 20, 2024

问题描述 | Describe the bug

快速点击评论的 like 按钮会导致一次性点多个赞或扣多个赞,在前端甚至会产生负数。需要加个锁。

问题网站 | Website URL

blog.reincarnatey.net

服务部署在哪里? | Where your waline deploy?

Vercel (Default)

数据存储在哪里?| Where your comment data store?

LeanCloud(https://leancloud.app)


Problem description | Describe the bug

Quickly clicking the like button of a comment will result in multiple likes or deductions at once, and may even produce a negative number on the front end. Need to add a lock.

Question Website | Website URL

blog.reincarnatey.net

Where is the service deployed? | Where your waline deploy?

Vercel (Default)

Where is the data stored? | Where your comment data store?

LeanCloud(https://leancloud.app)

@Raincarnator Raincarnator added the bug Something isn't working label Jul 20, 2024
@github-actions github-actions bot changed the title [Bug]: 快速点击 like 导致数据异常 [Bug]: 快速点击 like 导致数据异常 || [Bug]: Clicking like quickly causes data anomaly Jul 20, 2024
@lizheming
Copy link
Collaborator

lizheming commented Jul 21, 2024

点赞和文章反应,以及浏览量等纯计数的能力,预期就是给网站增加氛围的,所以当时没有想做的很重,就是一个单纯的计数就好了。你说的这些问题其实都是已知的,暂时不打算通过锁的方式去修复。目前应该是增加了一个前端接口请求中点击无效的操作(不确定有没有)去规避下这个问题。另外就是很多 serverless 的数据库也没有锁的能力~


The ability to purely count likes, article reactions, and page views was expected to add atmosphere to the website, so I didn’t want to do anything heavy at that time, just a simple count. The problems you mentioned are actually known, and there are no plans to fix them through locking for the time being. At present, an invalid click operation in the front-end interface request should be added (not sure if it exists) to avoid this problem. In addition, many serverless databases do not have lock capabilities~

@lizheming lizheming added discussion Question or dicussion and removed bug Something isn't working labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Question or dicussion
Projects
None yet
Development

No branches or pull requests

2 participants