Skip to content
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

fix: redirect loop when home bookmark has missing compare dimension #6317

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@
partialExplore,
metricsSpec,
);
redirectUrl.search = getUpdatedUrlForExploreState(
exploreSpec,
timeControlsState,
defaultExplorePreset,
partialExplore,
$page.url.searchParams,
);
if (shouldUpdateUrl) {
// if we added extra url params from sessionStorage then update the url
redirectUrl.search = getUpdatedUrlForExploreState(
exploreSpec,
timeControlsState,
defaultExplorePreset,
partialExplore,
$page.url.searchParams,
);
}
// update session store when back button was pressed.
if (backButtonUsed) {
updateExploreSessionStore(
Expand Down Expand Up @@ -183,7 +186,8 @@
// when there are no params set, state will be state from config yaml and any additional initial state like bookmark
initState = {
...exploreStateFromYAMLConfig,
...(initExploreState ?? {}),
// if the url changed manually then do not load data from initState, which is home bookmark or shared url's state
...(isManualUrlChange ? {} : (initExploreState ?? {})),
};
shouldUpdateUrl = !!initExploreState;
} else {
Expand Down Expand Up @@ -247,6 +251,7 @@
const newUrl = u.toString();
if (!prevUrl || prevUrl === newUrl) return;

prevUrl = newUrl;
// dashboard changed so we should update the url
void goto(newUrl);
// also update the session store
Expand Down
Loading