-
-
Notifications
You must be signed in to change notification settings - Fork 216
Fix unnecessary API queries to unreachable servers flooding console #843
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
Merged
mbecker20
merged 2 commits into
moghtech:1.19.4
from
MP-Tool:fix/server-status-based-api-queries
Sep 14, 2025
Merged
Fix unnecessary API queries to unreachable servers flooding console #843
mbecker20
merged 2 commits into
moghtech:1.19.4
from
MP-Tool:fix/server-status-based-api-queries
Sep 14, 2025
Conversation
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
mbecker20
reviewed
Sep 13, 2025
| const server = useServer(serverId); | ||
| return server && | ||
| server.info.state !== Types.ServerState.Disabled && | ||
| server.info.state !== Types.ServerState.NotOk; |
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.
This is simpler body:
const server = useServer(serverId);
return server?.info.state === Types.ServerState.Ok
mbecker20
reviewed
Sep 13, 2025
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.
Overall LGTM after the useIsServerAvailable simplification
mbecker20
approved these changes
Sep 14, 2025
Merged
mbecker20
pushed a commit
that referenced
this pull request
Sep 14, 2025
…843) * Implement server availability checks in various components * Refactor server availability check to ensure only healthy servers are identified
mbecker20
added a commit
that referenced
this pull request
Sep 14, 2025
* start 1.19.4 * deploy 1.19.4-dev-1 * try smaller binaries with cargo strip * deploy 1.19.4-dev-2 * smaller binaries with cargo strip * Fix Submit Dialog Button Behavior with 500 Errors on Duplicate Names (#819) * Implement enhanced error handling and messaging for resource creation * Implement improved error handling for resource creation across alerter, build, and sync * Implement error handling improvements for resource copying and validation feedback * Adjust error handling for resource creation to distinguish validation errors from unexpected system errors * Refactor resource creation error handling by removing redundant match statements and simplifying the error propagation in multiple API modules. * fmt * bump indexmap * fix account selector showing empty when account no longer found * clean up theme logic, ensure monaco and others get up to date current theme * enforce disable_non_admin_create for tags. Clean up status code responses * update server cache concurrency controller * deploy 1.19.4-dev-3 * Allow signing in by pressing enter (#830) * Improve dialog overflow handling to prevent clipping of content (#828) * Add Email notification entry to community.md (#824) * Add clickable file path to show/hide file contents in StackInfo (#827) * add clickable file path to show/hide file contents in StackInfo Also added CopyButton due to the new functionality making the file path not selectable. * Move clicking interaction to CardHeader * Avoid sync edge cases of having toggle show function capturing showContents from outside Co-authored-by: Maxwell Becker <[email protected]> * Format previous change * Add `default_show_contents` to `handleToggleShow` --------- Co-authored-by: Maxwell Becker <[email protected]> * deploy 1.19.4-dev-4 * avoid stake info ShowHideButton double toggle * Allow multiple simultaneous Action runs for use with Args * deploy 1.19.4-dev-5 * feat: persist all table sorting states including unsorted (#832) - Always save sorting state to localStorage, even when empty/unsorted - Fixes issue where 'unsorted' state was not persisted across page reloads - Ensures consistent and predictable sorting behavior for all DataTable components * autofocus on login username field (#837) * Fix unnecessary auth queries flooding console on login page (#842) * Refactor authentication error handling to use serror::Result and status codes * Enable user query only when JWT is present * Enable query execution in useRead only if JWT is present * Revert backend auth changes - keep PR focused on frontend only * Fix unnecessary API queries to unreachable servers flooding console (#843) * Implement server availability checks in various components * Refactor server availability check to ensure only healthy servers are identified * cargo fmt * fmt * Auth error handling with status codes (#841) * Refactor authentication error handling to use serror::Result and status codes * Refactor error messages * Refactor authentication error handling to include status codes and improve error messages * clean up * clean * fmt * invalid user id also UNAUTHORIZED * deploy 1.19.4-dev-6 * deploy 1.19.4-dev-7 --------- Co-authored-by: Marcel Pfennig <[email protected]> Co-authored-by: jack <[email protected]> Co-authored-by: Guten <[email protected]> Co-authored-by: Paulo Roberto Albuquerque <[email protected]> Co-authored-by: Lorenzo Farnararo <[email protected]>
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.
Problem:
While working on server management, I noticed that the frontend was making tons of unnecessary API calls to servers that have a "Not OK" status. Every time you visit a server page with an unreachable server, the UI tries to fetch system stats, CPU info, memory data, and container information - all of which are guaranteed to fail with 500 errors, flooding the browser console.
This creates several issues:
GetSystemStatsandGetSystemInformationSolution:
I've added server availability guards to prevent API calls to unreachable servers:
useIsServerAvailable()that checks if server state is notDisabledorNotOkenabledoption to check server availability firstThe fix uses React Query's
enabledoption with server status checks:This means:
The changes are backward compatible and respect existing server status logic that was already in place in some components.