Conversation
…ests Replace synchronous error throws in async route handlers with inline responses. Express 4 does not catch pre-await throws, causing requests to hang for 30s until timeout. Fixed 5 admin endpoints: - POST /admin/allowlist/add - DELETE /admin/allowlist/remove - GET /admin/impersonate/:wallet - POST /admin/api-keys/register - PATCH /admin/webhooks/:id Closes Junirezz#1368
…ields are a Closes Junirezz#1366
|
@Otaiki1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1368
Closes #1366
Closes #1365
Closes #1329
Closes #1368: Synchronous throws inside async Express handlers hang requests until timeout
Fixed synchronous throws in async Express handlers that caused requests to hang for 30 seconds until timeout.
Changes:
POST /admin/allowlist/add: Removed redundant validation throws (validation middleware handles 400)DELETE /admin/allowlist/remove: Replacedthrow new NotFoundError()with inlineres.status(404).json()+returnGET /admin/impersonate/:wallet: Replacedthrow new ValidationError()andthrow new ForbiddenError()with inline 400/403 responsesPOST /admin/api-keys/register: Replacedthrow new ValidationError()andthrow new ForbiddenError()with inline 400/403 responsesPATCH /admin/webhooks/:id: Replacedthrow new NotFoundError()with inline 404 responseAll fixes use the pattern
res.status(XXX).json({...}); return;to properly send error responses without leaving requests hanging in Express 4.Closes #1366: Schema snapshots drift when new health-check fields are added to /health or /ready
Stopped early by the maintainer, who reviewed the work so far. Includes changes to
backend/schema-snapshots/get-_health.json,backend/schema-snapshots/get-_ready.json,backend/src/__tests__/issues711.test.ts,backend/src/apiContractSnapshots.ts,backend/src/swagger.ts,backend/src/__tests__/openApiContractTests.test.ts.Opened with PRmaster after human review.