Repository navigation
Conversation
…ceState When gRPC is the default transport, the metrics page now sets it and connects the stream directly on first load and leaves the URL to submitQuery, because SvelteKit's replaceState can't run before its router has started. Switching transport with the toggle still records the choice in the URL. Adds component tests for the page and the client test setup file the config already referenced.
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.
On first load the API Manager metrics page picks its transport from
?transport=or, when theOBP API (gRPC)health check is up, defaults to gRPC. In that case it now sets the transport and opens the gRPC stream directly, and the URL getstransport=grpcfrom thesubmitQuerynavigation that follows, since SvelteKit'sreplaceStatecan only run once the router has started. Switching with the REST/gRPC toggle still writes the choice into the URL withreplaceState, so reloads and shared links keep it.The new component tests in
metrics/page.svelte.test.tsrender the page and check that a gRPC default opens the stream without callingreplaceState, that?transport=grpcdoes the same, that REST opens no stream, and that the toggle updates the URL. They run in the client test project, which now has thevitest-setup-client.tsits config referenced (the missingtest/setup.tsentry is dropped).vitest --runinapps/api-manager: 13 files, 106 tests pass.