Click buttons quickly in some forms will submit repeated/duplicated requests #7874

Closed
opened 2025-11-02 07:39:58 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @wxiaoguang on GitHub (Sep 21, 2021).

Description

All Gitea versions. Click buttons quickly in Issue form will submit repeated requests.

About UI/UX: because there is no UI feedback to users and the buttons are still clickable, when there is a laggy network, user may click buttons multiple times, then there will be many duplicated comments.

Related PRs (but it still needs more work)

Remaining works:

  • check and prevent repeated requests for other forms
  • prevent repeated requests for AJAX requests

Screenshots

image

NOTICE: This issue is not completely fixed. Some buttons have been fixed by https://github.com/go-gitea/gitea/pull/16157, but this issue is out-dated, so close it.

Originally created by @wxiaoguang on GitHub (Sep 21, 2021). ### Description All Gitea versions. Click buttons quickly in Issue form will submit repeated requests. * https://try.gitea.io/wxiaoguang/test/issues/1#issuecomment-91921 * And there are so many related issues ... About UI/UX: because there is no UI feedback to users and the buttons are still clickable, when there is a laggy network, user may click buttons multiple times, then there will be many duplicated comments. Related PRs (but it still needs more work) * https://github.com/go-gitea/gitea/pull/16157 , it prevents the `create issue/pr` and `create comment` button from double-clicked. * https://github.com/go-gitea/gitea/pull/10459 , partially replaced by #16157 Remaining works: * check and prevent repeated requests for other forms * prevent repeated requests for AJAX requests ### Screenshots <details> ![image](https://user-images.githubusercontent.com/2114189/145171000-0f31fa57-d4c9-4017-9691-0edb53a410b4.png) </details> NOTICE: This issue is not completely fixed. Some buttons have been fixed by https://github.com/go-gitea/gitea/pull/16157, but this issue is out-dated, so close it.
GiteaMirror added the issue/confirmedtopic/uitype/bug labels 2025-11-02 07:39:58 -06:00
Author
Owner

@delvh commented on GitHub (Sep 21, 2021):

I would say that is the same error as #6859 on another form.
This seems to be a general submission problem.

@delvh commented on GitHub (Sep 21, 2021): I would say that is the same error as #6859 on another form. This seems to be a general submission problem.
Author
Owner

@wxiaoguang commented on GitHub (Sep 21, 2021):

If you (gitea members) like my idea about frontend refactor (https://github.com/go-gitea/gitea/pull/16770#discussion_r702322766 , introduce a general method to pass template variables, not rely on html data tag, split index.js into separated js files, etc), I may take this one. I'd like to work on a clear frontend (or make it more clear), and I do not like to patch things again and again.

@wxiaoguang commented on GitHub (Sep 21, 2021): If you (gitea members) like my idea about frontend refactor (https://github.com/go-gitea/gitea/pull/16770#discussion_r702322766 , introduce a general method to pass template variables, not rely on html `data` tag, split index.js into separated js files, etc), I may take this one. I'd like to work on a clear frontend (or make it more clear), and I do not like to patch things again and again.
Author
Owner

@delvh commented on GitHub (Sep 21, 2021):

Not a Gitea member (yet), but I do approve of it. I completely agree that things should be fixed once, not n times.

@delvh commented on GitHub (Sep 21, 2021): Not a Gitea member (yet), but I do approve of it. I completely agree that things should be fixed once, not `n` times.
Author
Owner

@lunny commented on GitHub (Sep 22, 2021):

Spliting index.js is always welcome! And about the general method to pass template variables, any idea?

@lunny commented on GitHub (Sep 22, 2021): Spliting `index.js` is always welcome! And about the general method to pass template variables, any idea?
Author
Owner

@silverwind commented on GitHub (Aug 10, 2022):

I think a proper solution would be to interject all form submissions via JS, stop them and re-execute them via fetch. This can be used to prevent duplicate submission and more importantly enables to show a potential error message/toast without a page reload.

@silverwind commented on GitHub (Aug 10, 2022): I think a proper solution would be to interject all form submissions via JS, stop them and re-execute them via `fetch`. This can be used to prevent duplicate submission and more importantly enables to show a potential error message/toast without a page reload.
Author
Owner

@wxiaoguang commented on GitHub (Dec 13, 2022):

Some buttons have been fixed by #16157, this issue is out-dated, so close it.

@wxiaoguang commented on GitHub (Dec 13, 2022): Some buttons have been fixed by #16157, this issue is out-dated, so close it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7874