fix(grouping): Fix missing system-only stacktraces in similar issues diff view #73703
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.
As reported in #72607, sometimes the diff view (used on both the merged and similar issues tabs of the issue details page) shows no stacktraces, even when the events being compared do in fact have them.
The culprit turns out to be the check here, which filters the frames based on in-app status when the Seer similar issues flag is on. On an individual frame level, this works great, but it can leave the stacktrace overall in a bad state, with no frames to show, which happens whenever the flag is on and the stacktrace consists of nothing but system frames.
This fixes that by filtering the stacktrace as a whole before passing frames to
getFrame
, so we can recover if it turns out said filtering would leave us with no frames. It also refactors the tests a bit to make sure we're covering all cases.Fixes #72607.