-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref(feedback): fix show/hide logic for trace section, use placeholder while loading #79284
Conversation
(!hasProject || !crashReportId || oneOtherIssueEvent?.id === crashReportId); | ||
// Note traceEvents includes the current event (feedback). | ||
|
||
const [isCrashReportDup, setIsCrashReportDup] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether to show or hide the whole section - see return statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops the condition should be !isCrashReportDup
!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what exactly does is crash report dup mean? Sorry I don't really understand the bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedbacks submitted with an associated event ID have a section called "Linked Error" (CrashReportSection in code). When oneOtherIssueEvent
is defined, it means only one other event happens in the same trace. If the linked error and this event are the same, these sections would display a link to the same thing, and that's kinda redundant.
The bug was displaying this section only when it's a duplicate, instead of when it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically the other section gets error data from a SDK-submitted, explicit event ID, while this section gets it from the trace. In some cases having both would be redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the state here? it seems like const isCrashReportDupe = !isError && !isLoading && !!crashReportId && oneOtherIssueEvent?.id === crashReportId;
would be the same thing.
This reverts commit 6537c7d.
This reverts commit 5508fa3.
</Section> | ||
) : null; | ||
} | ||
|
||
function eventIsCrashReportDup( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function eventIsCrashReportDup( | |
function eventIsCrashReportDupe( |
Ref #68481
The show/hide logic had a bug where we were showing only if the same-trace issue is a duplicate of a crash report linked error. Which is the opposite of what we want. Example: JAVASCRIPT-2VE1. Analytics are still correct, but atm no timelines (2+ events) are shown.
Also:
hasProject
prop. It makes the logic hard to read, and was only used for the crash-report-dup condition. Comparing the issue ids is sufficient for this.