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

MNTOR-2929 - avoid server error and add logging, with followup #4185

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

rhelmer
Copy link
Collaborator

@rhelmer rhelmer commented Feb 9, 2024

References:

Jira: MNTOR-2929

Description

We can see from Sentry that getSubscriberByEmail sometimes returns undefined, which is causing server-side errors for some customers. Add temporary logging to diagnose, with a followup ticket filed to actually fix the problem (linked in FIXME comment).

How to test

We're not sure how to reproduce this yet, this will temporarily add extra logging in production (server only).

Checklist (Definition of Done)

  • Commits in this PR are minimal and have descriptive commit messages.
  • Jira ticket has been updated (if needed) to match changes made during the development process.

@rhelmer rhelmer requested a review from mansaj February 9, 2024 15:48
@rhelmer rhelmer self-assigned this Feb 9, 2024
@rhelmer rhelmer requested a review from Vinnl February 9, 2024 15:59
@@ -96,7 +97,12 @@ export async function getUserBreaches({
export async function getSubscriberBreaches(
user: Session["user"],
): Promise<SubscriberBreach[]> {
// FIXME this does not always return a subscriber https://mozilla-hub.atlassian.net/browse/MNTOR-2936
const subscriber = await getSubscriberByEmail(user.email);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we know if user.email is always present and not the problem?

Might as well log that if not

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mansaj we're logging the whole user object below, that's exactly the sort of thing I want to check. I think we need to be more consistent in what we use for looking up users - fxa ID would be better than email I think. I have a hunch what's causing this but I want to see the data first

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh sorry, i misread.. that makes sense

@@ -96,7 +97,12 @@ export async function getUserBreaches({
export async function getSubscriberBreaches(
user: Session["user"],
): Promise<SubscriberBreach[]> {
// FIXME this does not always return a subscriber https://mozilla-hub.atlassian.net/browse/MNTOR-2936
const subscriber = await getSubscriberByEmail(user.email);
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh sorry, i misread.. that makes sense

@rhelmer rhelmer merged commit 8090e3a into main Feb 9, 2024
12 of 13 checks passed
@rhelmer rhelmer deleted the MNTOR-2929/avoid-server-error-and-add-logging branch February 9, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants