Configure API proxy timeout - #2903
Open
TimDanielsCQI wants to merge 13 commits into
Open
Conversation
iamfrankiemoran
requested changes
Jul 23, 2026
iamfrankiemoran
left a comment
Contributor
There was a problem hiding this comment.
Minor change as part of the common-node-library changes
Contributor
Author
|
Changes done to this library (including readme) and opal-frontend pr |
iamfrankiemoran
left a comment
Contributor
There was a problem hiding this comment.
LGTM once library is released and bumped here
Contributor
Author
|
Have updated this branch to consume opal-frontend-common-node-lib v0.0.43 |
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.
Jira link
See PO-3939
Change description
Updates
@hmcts/opal-frontend-common-nodefrom0.0.39to released version0.0.43.This consumes the shared proxy timeout and error-handling support delivered in opal-frontend-common-node-lib#368.
The frontend branch configures a 30-second API proxy timeout and passes it to both the Fines Service and User Service proxies. Startup now fails clearly if that timeout configuration is absent.
The upgraded shared library:
504 Gateway Timeoutproblem response withretriable: true;502 Bad Gatewaywithretriable: false;sequenceDiagram participant B as Browser participant F as opal-frontend SSR server participant P as Express proxy route<br/>OpalApiProxy participant O as opal-fines-service B->>F: GET /sign-in or app route F-->>B: HTML / JS / SSR response B->>F: API call to /opal-fines-service/... F->>P: Route matched in Express P->>O: Proxied request to upstream backend O-->>P: Backend response P-->>F: Proxied response returned F-->>B: Final HTTP response alt backend times out / transport failure P-->>F: 504 or 502 problem response F-->>B: Deterministic error payload endTesting completed
@hmcts/opal-frontend-common-nodeto exactly0.0.43.corepack yarn build:ssr— passed.corepack yarn test:coverage— passed: 288 test files, 2,941 tests.http://localhost:4550/healthreturned HTTP 200.http://localhost:4200/sign-inreturned HTTP 200.The exact smoke test that I did was:
Testing the timeout and retry
Use the server already running on PO-3939 at
http://localhost:4200.Open a Terminal and confirm the local Fines container is running:
The name is normally:
In Chrome, open
http://localhost:4200/sign-inand sign in.Open Developer Tools → Network:
business-units.Navigate to a point just before a Fines data request. Recommended:
In the second Terminal, freeze Fines:
“Pause” freezes the backend without closing its connection. The frontend proxy can connect, but receives no reply.
Immediately press Continue in the browser.
Wait approximately 65 seconds. PO-3939’s default timeout is 30 seconds:
504;504;In Chrome Network, confirm two requests to the same Fines endpoint. Each should show:
{ "title": "Gateway Timeout", "status": 504, "detail": "The backend service did not respond in time.", "retriable": true }Restore Fines immediately:
Refresh the page or start the journey again to confirm the local stack is normal.
Only do this against your own local Docker stack!
Security Vulnerability Assessment
CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?
Checklist