Ability to control the timeout of button-longrunning
See original GitHub issueIs your proposal related to a problem?
The button-longrunning
class currently provides a UI indication via the submit button animation that a long running form submission is being processed, but it doesn’t take into account the server response, so it times out and shows complete even though the task is not.
Describe the solution you’d like
The button-longrunning class should take into account the server’s response, if possible. For example I have my Nginx timeout set to 300 seconds, the max body size set to 300mb, and the gunicorn worker timeout set to 300 seconds to allow for > 100mb audio file uploads for podcast episodes, but after seemingly 30 seconds, the button-longrunning
animation expires, leaving the user with an erroneous form display.
The task completes if they ignore the UI, but that is obviously not optimal.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
RFC up for adoption of Stimulus JS with a potential path forward on this issue through a
data-*
attributes driven API on the button element, irrespective of where used (even when added to a modal dynamically) it would attach the JS behaviour as desired.https://github.com/wagtail/rfcs/pull/78
Feedback welcome on that RFC’s PR.
Having a fixed timeout is important, remember it is not simple to track if a Promise never resolves without some central shared handling using something like Promise.race.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race
Hence it is difficult to know if the network has failed/never resolved/ timed out somewhere and then if the user can safely click the button again.