fix(replays): Clear stale filters when changing replay tabs#116768
Merged
nsdeschenes merged 8 commits intoJun 3, 2026
Conversation
Move replay detail filter URL state to typed nuqs parsers so tests exercise the router query behavior instead of mocked navigation.
Remove replay detail filter query parameters when the active replay tab changes so stale pane state does not carry into the next tab.
Include fetch and 200 as network filter options even when the loaded replay frames do not contain those values.
Contributor
Author
|
@sentry review |
Contributor
Author
|
@cursor review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7d628c3. Configure here.
Contributor
📊 Type Coverage Diff✅ no issues found |
Make replay detail filter field types module-local after tests stopped importing them. This keeps knip from reporting unused exported types.
Use the nuqs parser map as the source of truth for replay detail filter query updates. This removes the generic Query path that introduced new any-typed symbols and a query type assertion.
Replace the per-key object spread update with a typed helper that normalizes provided replay detail filters to nullable nuqs values.
Contributor
Author
|
@sentry review |
Contributor
Author
|
@cursor review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit dfeec90. Configure here.
Split replay detail filter keys by value type so the nullable update helper stays typed without a one-use generic parameter.
Ensure replay detail location query filters cannot drift from the parser map. Adding a parser without adding it to a handled key group now fails typechecking instead of silently dropping URL state updates. Co-Authored-By: Codex <codex@openai.com>
ryan953
approved these changes
Jun 3, 2026
NicoHinderling
added a commit
that referenced
this pull request
Jun 3, 2026
The nuqs testing adapter (`tests/js/sentry-test/nuqsTestingAdapter.tsx`) captured `location` from `useLocation()` inside its `updateUrl` and `getSearchParamsSnapshot` closures. Because nuqs flushes updates on a deferred tick (always at least `setTimeout(0)`), two setter calls fired back-to-back composed onto a **stale** render snapshot — so the second update dropped query params set by the first. This surfaced after the `useFiltersInLocationQuery` migration to nuqs `useQueryStates` (#116768). The old code merged manually (`{...query, ...updatedQuery}`) and always preserved prior params; the new code delegates preservation to nuqs reading the live URL. `useErrorFilters.spec` then failed because calling `setSearchTerm` after a project filter dropped `f_e_project`. This reads `location` through a ref that's updated every render, so the deferred flush composes onto the live URL — matching the real react-router v6 adapter, which reads `window.location`/`history` fresh at flush time. It's a test-harness correction: production was never affected, since the production adapter already reads live location and composes sequential setters correctly. Considered making the adapter read `window.location` directly like production, but Sentry's TestRouter is in-memory, so a latest-ref over `useLocation` is the correct source. Co-authored-by: Claude <noreply@anthropic.com>
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.
Replay detail filters now use typed
nuqsquery state and are cleared when users switch replay tabs. This prevents stale pane-specific filters or selected network details from carrying into another replay tab.Replay Detail Filters
The shared replay filter hook now owns the known detail query parsers, and tests exercise real router query updates instead of mocked navigation.
Network Filter Defaults
The network filter menu keeps
fetchand200available even when the current replay frames do not include those values.