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

bug: deselecting a checkpoint breaks the dashboard in certain scenarios #748

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions tools/oversight/slicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,15 @@ export function updateState() {
});
});

// remove all source and target filters if their specific checkpoint
// is not in the checkpoint filter
url.searchParams.entries().filter(([key]) => key.match(/\.(source|target)$/))
.forEach(([key]) => {
const [cp] = key.split('.');
if (!url.searchParams.getAll('checkpoint').includes(cp)) {
url.searchParams.delete(key);
}
});
// iterate over all existing URL parameters and keep those that are known facets
// and end with ~, so that we can keep the state of the facets
searchParams.forEach((value, key) => {
Expand Down
10 changes: 10 additions & 0 deletions tools/rum/slicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,16 @@ export function updateState() {
});
url.searchParams.set('domainkey', searchParams.get('domainkey') || 'incognito');

// remove all source and target filters if their specific checkpoint
// is not in the checkpoint filter
url.searchParams.entries().filter(([key]) => key.match(/\.(source|target)$/))
.forEach(([key]) => {
const [cp] = key.split('.');
if (!url.searchParams.getAll('checkpoint').includes(cp)) {
url.searchParams.delete(key);
}
});

window.history.replaceState({}, '', url);
document.dispatchEvent(new CustomEvent('urlstatechange', { detail: url }));
}
Expand Down
Loading