Skip to content

[BUGFIX] Fix endless loader in validation form on failed requests - #2221

Merged
sebastian-meyer merged 2 commits into
kitodo:mainfrom
stweil:fix/validation-form-loader
Oct 27, 2026
Merged

sebastian-meyer merged 2 commits into
kitodo:mainfrom
stweil:fix/validation-form-loader

Conversation

@stweil

@stweil stweil commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

The Validation plugin removes its loading indicator only in the happy path of the fetch promise chain (and only after the response has been parsed as JSON). Any other outcome - a network error, an aborted connection, or a non-JSON error page - is never handled, so the spinner keeps spinning indefinitely, the submit button stays clickable, and each click starts another pending request.

Handle all request outcomes and always restore the form:

  • catch network errors and non-JSON responses and show an error message instead
  • abort the request after a 60 second timeout and show a dedicated timeout message
  • disable the submit button while a request is pending so requests cannot stack

This becomes visible when the server is slow or unavailable (the underlying validation middleware has a 30 second timeout of its own), leaving the user with a page that appears to be frozen until a reload.

Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)

@stweil

stweil commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Note that a test on a real installation is still pending.

@sebastian-meyer sebastian-meyer added the ☇ bug A non-security related bug. label Oct 21, 2026
Comment thread Resources/Private/Language/de.locallang.xlf Outdated
Comment thread Resources/Private/Language/de.locallang.xlf Outdated

@markusweigelt markusweigelt left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! However, I can’t test it at the moment because my development environment is outdated and I don’t have the necessary project resources. I’ve assigned @beatrycze-volk as a reviewer since she restructured the validation form and the flow a bit and may be able to test the changes directly.

@stweil
stweil force-pushed the fix/validation-form-loader branch from d8aaa94 to 5f5274e Compare October 21, 2026 07:49
Comment thread Resources/Private/Language/de.locallang.xlf Outdated
Comment thread Resources/Private/Language/de.locallang.xlf Outdated
Comment thread Resources/Private/Language/locallang.xlf Outdated
Comment thread Resources/Private/Language/locallang.xlf Outdated
Comment thread Resources/Private/Templates/ValidationForm/Main.html Outdated
The Validation plugin removes its loading indicator only in the
happy path of the fetch promise chain (and only after the response has
been parsed as JSON). Any other outcome - a network error, an aborted
connection, or a non-JSON error page - is never handled, so the
spinner keeps spinning indefinitely, the submit button stays
clickable, and each click starts another pending request.

Handle all request outcomes and always restore the form:
- catch network errors and non-JSON responses and show an error
  message instead
- abort the request after a 60 second timeout and show a dedicated
  timeout message
- disable the submit button while a request is pending so requests
  cannot stack

This becomes visible when the server is slow or unavailable (the
underlying validation middleware has a 30 second timeout of its own),
leaving the user with a page that appears to be frozen until a reload.

Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
stweil force-pushed the fix/validation-form-loader branch from 0b93ee9 to 4afa803 Compare October 26, 2026 10:22
@sebastian-meyer
sebastian-meyer merged commit e4849e4 into kitodo:main Oct 27, 2026
10 checks passed
@stweil
stweil deleted the fix/validation-form-loader branch October 27, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☇ bug A non-security related bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants