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

chore(feedback): Analytics for error rendering feedback item #78978

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

c298lee
Copy link
Member

@c298lee c298lee commented Oct 10, 2024

Adds analytics for error when rendering feedback item. Also fixes loading screen when the feedback does not exist

@c298lee c298lee requested a review from a team as a code owner October 10, 2024 21:48
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 10, 2024
Comment on lines 25 to 27
if (issueResult.isError) {
trackAnalytics('feedback.feedback-item-render-error', {organization, feedbackId});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no sentry error when this happens? We should not need to capture error analytics :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I don't see anything in Issues....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@ryan953 ryan953 Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like there was no error because of the issueData? down below: it's possible that the data doesn't exist and we handle it without throwing. Not an error, but also it wasn't a good user experience until now.

Tracking how often are people asking for feedbacks that don't exist seems reasonable, maybe we should tweak the analytics name

Copy link
Member

@aliu39 aliu39 Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about feedback.feedback-item-missing-data? or no-data feedback.feedback-item-not-found?

Copy link
Member

@aliu39 aliu39 Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I did something similar for feedback trace data, I also called the event an "error"..

Is 404 the only likely cause of isError here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can split these if conditions to separate useEffect's

@@ -49,7 +49,7 @@ export default function useFetchFeedbackData({feedbackId}: Props) {
// Until that is fixed, we're going to run `markAsRead` after the issue is
// initially fetched in order to speedup initial fetch and avoid race conditions.
useEffect(() => {
if (issueResult.isFetched && !issueData?.hasSeen) {
if (issueResult.isFetched && issueData && !issueData.hasSeen) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

Copy link
Member

@michellewzhang michellewzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@c298lee c298lee merged commit dfdf78a into master Oct 15, 2024
42 of 43 checks passed
@c298lee c298lee deleted the cl/feedback-metrics branch October 15, 2024 14:47
cmanallen pushed a commit that referenced this pull request Oct 23, 2024
Adds analytics for error when rendering feedback item. Also fixes
loading screen when the feedback does not exist
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants