Skip to content

fix: unverified primary emails break Emails and Users page

Administrator requested to merge bee/email-bug into main

Created by: abeatrix

To close https://github.com/sourcegraph/sourcegraph/issues/29120

This has also been raised by a customer as this blocked them from using code monitor (Slack thread)

Issue: unverified primary emails break Emails and Users page

Steps to reproduce

  1. Log in as a Site Admin > Create a new user without an email image 2 Then go to the Users page, look for the newly created user image
  2. Click on the username > Emails > add a new email address image
  3. The Emails page will be stuck in loading image
  4. Refreshing the page would display an error message but nothing can be done in the UI image
  5. It would also break the Users page for Site Admin, again, nothing can be done in the UI to reverse this image

Root cause - Frontend

  • Problem: The User Settings Emails Page will ONLY display error message when an error is presented.
    • This prevents users / site admins to make any changes through the UI when an error occurs
    • In this case, users and site admins are not able to verify or remove the emails that breaks the page
  • Solution suggested in this PR:
    • Display both the error message AND the Emails settings component that allows users and site admin to be aware of the error messages and provide them with the ability to fix them
    • Users can see the Emails page UI that allows them to remove unverified email / Resend verification email / add new emails etc image

Root cause - Backend:

  • Problem: The IsPrimary function returns an error saying User email not found if primary email is not verified, when it should just return false
  • Solution suggested in this PR:
    • Update this function to return true or false only image

Test plan

manually tested?

Merge request reports

Loading