Skip to content

[$250] Domains - Not here page opens after removing yourself as admin #80346

Closed

Description

@nlemma

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.6-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #79765
Email or phone of affected tester (no customers): applausetester+210102abc@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Log in as domain admin which is not primary contact.
  1. Go to staging.new.expensify.com
  2. Go to Workspaces.
  3. Scroll to the bottom.
  4. Tap applause.expensifail.com domain.
  5. Go to Domain admins.
  6. Tap on your own profile.
  7. Tap Revoke access.
  8. Tap Remove.

Expected Result:

User will be redirected to Workspaces page after removing themselves as admin.

Actual Result:

Not here page opens after removing themselves as admin.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7055394_1769072774874.12.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022014735920364075423
  • Upwork Job ID: 2014735920364075423
  • Last Price Increase: 2026-01-23
  • Automatic offers:
    • MobileMage | Contributor | 110313073
Issue OwnerCurrent Issue Owner: @

Activity

  1. added
    Daily
    Bug
    on Jan 23, 2026
  2. melvin-bot commented on Jan 23, 2026

    @melvin-bot

    Triggered auto assignment to @heyjennahay (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. MobileMage commented on Jan 23, 2026

    @MobileMage
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a domain admin removes their own admin access from a domain, they see a "Not here" error page instead of being redirected to the Workspaces page. The expected behavior is that after revoking their own admin access, the user should be automatically redirected to the Workspaces list page.

    What is the root cause of that problem?

    The root cause is that DomainInitialPage does not have a useEffect to navigate the user away when they lose admin access.

    When the user clicks "Revoke access" to remove themselves as admin:

    1. In DomainAdminDetailsPage.tsx (lines 65-66), the handleRevokeAdminAccess function calls:

      • revokeDomainAdminAccess(route.params.domainAccountID, route.params.accountID)
      • Navigation.dismissModal()
    2. The dismissModal() closes the RHP (Right Hand Panel) containing DomainAdminDetailsPage, returning to the underlying DomainInitialPage.

    3. In DomainInitialPage.tsx (lines 108-115), the page renders FullPageNotFoundView with shouldShow={!domain || !isAdmin}:

      <FullPageNotFoundView
          onBackButtonPress={() => Navigation.dismissModal()}
          onLinkPress={Navigation.goBackToHome}
          shouldShow={!domain || !isAdmin}
          ...
      >
    4. Since the user is no longer an admin (the SHARED_NVP_PRIVATE_ADMIN_ACCESS Onyx key gets updated), isAdmin becomes false, and the "Not here" page is shown.

    The problem is that DomainInitialPage only renders the "Not here" view but does NOT automatically navigate the user away. Other wrapper components like DomainNotFoundPageWrapper (lines 40-47) and AccessOrNotFoundWrapper (lines 200-206) have useEffect hooks that handle this scenario by navigating the user away when access is lost.

    DomainNotFoundPageWrapper.tsx (lines 40-47):

    useEffect(() => {
        if (shouldShowFullScreenLoadingIndicator || (domain && isAdmin)) {
            return;
        }
        Navigation.dismissModal();
    }, [domain, isAdmin, shouldShowFullScreenLoadingIndicator]);

    But DomainInitialPage doesn't use DomainNotFoundPageWrapper - it directly renders FullPageNotFoundView without any automatic navigation on access loss.

    What changes do you think we should make in order to solve the problem?

    Add a useEffect in DomainInitialPage.tsx to navigate the user to the Workspaces list page when they lose admin access, similar to how DomainNotFoundPageWrapper handles this case.

    File: /src/pages/domain/DomainInitialPage.tsx

    Add a useEffect after the existing hooks (around line 93):

    +    useEffect(() => {
    +        if (domain && isAdmin) {
    +            return;
    +        }
    +
    +        Navigation.goBack(ROUTES.WORKSPACES_LIST.route);
    +    }, [domain, isAdmin]);
    +
         return (
             <ScreenWrapper

    This approach:

    1. Detects when the user loses admin access (either !domain or !isAdmin)
    2. Navigates back to the Workspaces list page using Navigation.goBack(ROUTES.WORKSPACES_LIST.route), which is consistent with other navigation patterns in this page (line 118)

    What alternative solutions did you explore? (Optional)

  4. dmkt9 commented on Jan 23, 2026

    @dmkt9
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Not here page opens after removing themselves as admin.

    What is the root cause of that problem?

    isCurrentUserPrimaryContact has the value false, so the "revoke admin access" button is not disabled.

    const isCurrentUserPrimaryContact = primaryContact === memberLogin;

    This is because primaryContact here has the value undefined.
    const [primaryContact] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${domainAccountID}`, {
    selector: domainSettingsPrimaryContactSelector,
    canBeMissing: true,
    });

    What changes do you think we should make in order to solve the problem?

    We should fallback to the primaryContact value in the account:

    + const primaryContactFromAccountSelector = (account: OnyxEntry<Account>) => account?.primaryLogin;

    +    const [primaryContactFromAccount] = useOnyx(ONYXKEYS.ACCOUNT, {
    +        selector: primaryContactFromAccountSelector,
    +        canBeMissing: true,
    +    });

    const isCurrentUserPrimaryContact = primaryContact === memberLogin;

        const isCurrentUserPrimaryContact = (primaryContact ?? primaryContactFromAccount) === memberLogin;

    What alternative solutions did you explore? (Optional)

    N/A

  5. added
    External
    on Jan 23, 2026
  6. changed the title [-]Domains - Not here page opens after removing yourself as admin[/-] [+][$250] Domains - Not here page opens after removing yourself as admin[/+] on Jan 23, 2026
  7. melvin-bot commented on Jan 23, 2026

    @melvin-bot
  8. added
    Help Wanted
    on Jan 23, 2026
  9. melvin-bot commented on Jan 23, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (External)

  10. github-actions commented on Jan 26, 2026

    @github-actions
    Contributor

    ⚠️ @M00rish Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  11. 31 remaining items

  12. Krishna2323 commented on Feb 26, 2026

    @Krishna2323
    Contributor

    @mountiny could you please reopen this?

  13. added and removed
    Weekly
    on Mar 23, 2026
  14. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @heyjennahay, @mountiny, @Krishna2323, @MobileMage eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  15. Krishna2323 commented on Apr 1, 2026

    @Krishna2323
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: Improvement as per this comment.

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/619641

    Regression Test Proposal

    Precondition:

    • Log in as a domain admin which is not the primary contact.

    Test:

    Test 1 — Self-revoke redirects to Workspaces:

    1. Go to dev.new.expensify.com
    2. Go to Workspaces (bottom tab bar)
    3. Scroll to the bottom of the Workspaces list
    4. Tap the domain (e.g. applause.expensifail.com)
    5. Tap Domain admins
    6. Tap on your own profile
    7. Tap Revoke access
    8. Tap Remove to confirm
    9. Verify you are redirected to the Workspaces page (not a "Not here" page)
    10. Verify that no errors appear in the JS console

    Test 2 — Normal admin access still works:

    1. Log in as a domain admin
    2. Navigate to Workspaces > domain > Domain admins
    3. Verify the page loads normally and you can see the list of admins
    4. Navigate to Workspaces > domain > SAML
    5. Verify the page loads normally
    6. Verify that no errors appear in the JS console
    7. Verify that no errors appear in the JS console

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-99fe-a7ed-1bf0-87b1a2359414
  16. Krishna2323 commented on Apr 1, 2026

    @Krishna2323
    Contributor

    @mallenexpensify checklist completed ^. The PR was deployed to prod a month ago: #81209 (comment)

  17. added
    Daily
    and removed
    Reviewing
    on Apr 2, 2026
  18. mallenexpensify commented on Apr 2, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @MobileMage paid $250 via Upwork
    Contributor+: @Krishna2323 due $250 via NewDot

    ^ Test case created

    Apologies for the delay

  19. Krishna2323 commented on Apr 4, 2026

    @Krishna2323
    Contributor

    Requested in ND.

  20. twisterdotcom commented on Apr 5, 2026

    @twisterdotcom
    Contributor

    @Krishna2323 has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-7752-a79e-acf7-636368aef344
  21. quinthar commented on Apr 13, 2026

    @quinthar
    Contributor

    Approved $250 to @Krishna2323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions