-
Notifications
You must be signed in to change notification settings - Fork 151
Address code review feedback on endpoint health status component #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
6
commits into
12-15-invoke_the_endpoints_health_check_in_web_o11y_and_render_result_in_toolbar
Choose a base branch
from
copilot/sub-pr-615
base: 12-15-invoke_the_endpoints_health_check_in_web_o11y_and_render_result_in_toolbar
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+128
−22
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ca6fc12
Initial plan
Copilot 847ba4a
Fix endpoints health status based on code review feedback
Copilot f6fc9d7
Address code review feedback on health status component
Copilot 4fb4dd7
Extract health check message constant for consistency
Copilot c62acfb
Add explicit error handling for aborted health checks
Copilot c6502f9
Fix loading state cleanup and improve postgres URL hashing
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| '@workflow/core': patch | ||
| '@workflow/web': patch | ||
| --- | ||
|
|
||
| Fix endpoints health status component based on code review feedback | ||
|
|
||
| - Fixed base URL determination to handle non-local backends (vercel, postgres) | ||
| - Improved config key generation to include all relevant backend-specific fields | ||
| - Fixed useEffect dependencies to prevent unnecessary re-checks | ||
| - Added cleanup handler for unmounted component to prevent React warnings | ||
| - Documented CORS security implications in code comments |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The health check requests now lack a timeout when called from the component because the abort signal provided is used instead of composing it with the timeout.
View Details
Analysis
Fetch timeout lost when AbortSignal provided to checkEndpointHealth()
What fails: The
checkEndpointHealth()function inpackages/web/src/components/display-utils/endpoints-health-status.tsxuses the patternsignal: signal || AbortSignal.timeout(5000)which removes the timeout guarantee when a signal is provided. When called from the component'suseEffectwithabortController.signal, the timeout is discarded, causing fetch requests to hang indefinitely if the server doesn't respond.How to reproduce:
EndpointsHealthStatuscomponentnc -l localhost:3000)abortController.abort())Result: The fetch hangs until component unmounts. With the buggy code using
signal || AbortSignal.timeout(5000):signalparameter is theabortController.signal(truthy)signal, notAbortSignal.timeout(5000)Expected: The fetch should timeout after 5 seconds OR when the component unmounts, whichever comes first.
Fix applied: Changed line 120-122 to compose the signals using
AbortSignal.any():This ensures:
AbortSignal.timeout(5000)onlyVerified with Node.js v22.14.0.
AbortSignal.any()is available in Node.js 18.17.0+, matching project's minimum requirement of Node.js ^18.0.0.