UI Freeze issue in before_workflow_action event

I have implemented a custom validation for backdated transactions. However, I’m encountering a UI freeze after submitting the document when this logic runs inside the before_workflow_action event.

What’s confusing is that this issue only occurs in before_workflow_action. When I place the same validation logic in other events, such as validate, everything works perfectly and the UI does not freeze.

I would appreciate any guidance on:

  • Why before_workflow_action behaves differently from validate

  • Whether there are known limitations or best practices when performing async calls or dialogs in before_workflow_action

  • How I can properly fix or refactor this to avoid the UI freeze

Please see the image below for reference.

Thank you in advance for your help.