Closed Bug 1651898 Opened 2 years ago Closed 2 months ago

MozPhab is failing to continue if user has empty primaryEmail field

Categories

(Conduit :: moz-phab, defect, P2)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: zalun, Assigned: sheehan)

Details

(Keywords: conduit-triaged)

Attachments

(1 file)

The response["email"] is None.
MozPhab should warn the user and continue to work with Telemetry switched off.

DEBUG    2020-07-09 22:14:24,028 https://phabricator.services.mozilla.com/api/user.whoami {}
ERROR    2020-07-09 22:14:28,072 Traceback (most recent call last):
  File "c:\Users\Bas\Dev\mozilla-build\python3\lib\site-packages\mozphab\mozphab.py", line 73, in main
    telemetry.set_metrics(args, is_development=is_development)
  File "c:\Users\Bas\Dev\mozilla-build\python3\lib\site-packages\mozphab\telemetry.py", line 150, in set_metrics
    self.update_user_data()
  File "c:\Users\Bas\Dev\mozilla-build\python3\lib\site-packages\mozphab\telemetry.py", line 102, in update_user_data
    is_employee_changed = user_data.set_user_data()
  File "c:\Users\Bas\Dev\mozilla-build\python3\lib\site-packages\mozphab\user.py", line 96, in set_user_data
    whoami = self.whoami()
  File "c:\Users\Bas\Dev\mozilla-build\python3\lib\site-packages\mozphab\user.py", line 70, in whoami
    if response["email"].lower().endswith("@mozilla.com"):
AttributeError: 'NoneType' object has no attribute 'lower'
Severity: S1 → --

It is possible for a user to have an empty primaryEmail field
in their Conduit response. Account for this potential state,
logging a warning that advises them to add a primary email in
their Phabricator settings. If they don't have a primary email
set, assume they are not an employee and return.

Assignee: nobody → sheehan
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.