Skip to content

Await OpenAPI authorization and handler disposal - #141

Open
RichardHoekstra wants to merge 1 commit into
WebHare:mainfrom
RichardHoekstra:github/fix/openapi-awaited-disposal
Open

RichardHoekstra wants to merge 1 commit into
WebHare:mainfrom
RichardHoekstra:github/fix/openapi-awaited-disposal

Conversation

@RichardHoekstra

Copy link
Copy Markdown
Contributor

Problem

The OpenAPI dispatcher launches context cleanup with void. Handlers can start before authorization cleanup finishes, and responses can return while handler resources remain alive. Cleanup rejections are detached.

Change

Use await using within the existing timing scopes. Finish authorization disposal before handler dispatch and handler disposal before returning. Preserve combined operation/disposal errors through SuppressedError.

Validation

system.nodejs.test_openapicleanup fails before and passes after. Seven tests exercise the real dispatcher with cleanup barriers, failures, denied authorization and an independent overlapping request.

Selected compatibility, TypeScript and unchanged ESLint checks pass.

Compatibility

Cleanup contributes to phase timing and request outcome. A cleanup error after a committed effect does not imply rollback.

Validated on the official 6.2 image for GitHub main a91a7a28, with the candidate sources installed. Full upstream CI has not been run.

@RichardHoekstra
RichardHoekstra requested a review from a team October 27, 2026 15:41

This branch was successfully deployed

1 active deployment
external-ci — 59fa9ad2 Deployed Oct 27, 2026 by RichardHoekstra via setup #204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant