Skip to content

Conversation

svozza
Copy link
Contributor

@svozza svozza commented Sep 19, 2025

Summary

Handles the case where middleware does not await the next() handler, which causes the the order of middleware to become interminate.

Changes

  • Add logic to composeMiddleware function to detect if next function has not been awaited.
  • Unit test to cover this case

Issue number: closes #4510


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@svozza svozza self-assigned this Sep 19, 2025
@boring-cyborg boring-cyborg bot added event-handler This item relates to the Event Handler Utility tests PRs that add or change tests labels Sep 19, 2025
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Sep 19, 2025
Copy link

@dreamorosi dreamorosi merged commit b0b43e8 into main Sep 22, 2025
37 checks passed
@dreamorosi dreamorosi deleted the event-handler/throw-middleware-no-await-next branch September 22, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-handler This item relates to the Event Handler Utility size/M PR between 30-99 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Detect When Middleware Does Not Await Next Callback in REST API
3 participants