Fixed session clean-up, websocket connection, and data loading logic#43
Merged
Fixed session clean-up, websocket connection, and data loading logic#43
Conversation
…dated the redirect check in the 'Session' route to use the new data structure
* Added a state to keep track of whether the session is being cleaned up * Disables the bin and broom buttons when a session is being cleaned up * Changes the PuffLoader color logic; it's green when a transfer is in progress, red when cleaning up, and a static grey when the session is disconnected
* Renamed 'getSessionsData' to 'getAllSessionsData' to better distinguish it from 'getSessionData' * Similarly renamed 'sessionsLoader' to 'allSessionsLoader' * Migrated query-based functions and variables into the loaders they are called in, to keep dependencies focused * Used `invalidateQueries` in loaders to make sure that fresh data is fetched from the backend every time a page with session-related information is loaded
…ssage appears and disappears correctly; also fixed incorrect polling interval in comment
* Removed the 'useEffect()' for cleaning up the URl now that URL query parameters are no longer needed * Rearranged defined variables and functions by type * Added comments
…me, now that it's no longer needed
… then implemented inside 'ProtectedRoutes' so that it persists when navigating across all relevant pages
…f 'useLoaderData' * Changed 'allSessionsLoader' loader function to return 'queryClient.ensureQueryData()' to prefetch and catch session information before route renders
* Pass it the instrument name from the 'Home' route * Use 'queryClient.refetchQueries()' to update the loaded session information after a delete instead of refreshing the window
…e session information is always fresh
…me, and is compatible with 'useQuery'
…'sessionActive' state and closes the pop-up after successful execution
…ent with an animated Sync icon instead
… trigger a query refetch when there is a change in connectivity status
…om parent component now that we are using queries to update the data
…s in instrument connectivity is detected
… RSyncer information for a given session
* Use a query to fetch and update RSyncer data from the backend * Remove the need to pass functions to the RSyncCard components now that we are using queries * Added logic to stop polling when the instrument server connection is lost
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.
This PR introduces a variety of improvements
MultigridControllerobject in Murfey (see PR #641)SessionRowcomponent to show when sessions are in progress, being cleaned up, or inactiveWebSocketHandlerin theProtectedRoutescomponent, which all session-related pages inherit fromSessionpage will now stop polling the backend when connection with the instrument server is lostSessionRowsin theHomepage will now update their status when the instrument server connection is lostsessionsLoadertoallSessionsLoaderso that it's easier to distinguish fromsessionLoader.