Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from urllib.parse import urlencode, urlparse

import requests
import sentry_sdk
from django.conf import settings
from django.contrib.auth.hashers import check_password
from django.contrib.auth.password_validation import validate_password
Expand Down Expand Up @@ -928,7 +929,8 @@ def report_integrity(request):
request_id=request_id,
device_id=device_id,
)
except DuplicateSampleRequestError:
except DuplicateSampleRequestError as e:
sentry_sdk.capture_exception(e)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So we can track if there's something funky going on...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: I don't think this is strictly necessary (but fine to do). I don't know that getting a duplicate request is something we need to be concerned about, and I want to be in the habit of keeping sentry full of only actionable errors rather than ones we say "that is fine" about as much as we can.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The only reason I added the sentry logging was so we can know if there's spamming or so going on (i.e. endpoint is hit with the same request_id multiple times) so we can let mobile know to look into it.

return JsonResponse({"result_code": None}, status=200)
except HttpError:
return JsonResponse({"result_code": None}, status=500)
Expand Down