Skip to content

[$250] Domains - No RBR error on the Domain Admins page when changing primary contact fails #80206

Closed

Description

@jponikarchuk

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@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Mac 26.1 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  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. Click Settings.
  7. Open CMD+D and enable "Simulate failing network requests", close the modal.
  8. Click Primary contact.
  9. Select other contact.
  10. Close the RHP.

Expected Result:

  • An RBR error appears on the Domain Admins page.
  • Clicking the error navigates to the Settings RHP.

Actual Result:

There is no RBR error on the Domain Admins page.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022014812157853469840
  • Upwork Job ID: 2014812157853469840
  • Last Price Increase: 2026-01-30
  • Automatic offers:
    • situchan | Reviewer | 110312983
Issue OwnerCurrent Issue Owner: @war-in

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 22, 2026
  2. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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. cosmicvulpes commented on Jan 22, 2026

    @cosmicvulpes
    Contributor

    Proposal

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

    When changing the primary contact on the Domain Admins Settings page fails (e.g., due to network failure), no RBR error indicator appears on the Domain Admins page to guide users to the Settings RHP where the actual error is displayed.

    What is the root cause of that problem?

    The DomainAdminsPage subscribes to domainErrors from Onyx but only uses adminErrors for displaying errors on admin list items. The Settings button (lines 77-83) does not check for or display errors from technicalContactEmailErrors or useTechnicalContactBillingCardErrors.

    While errors are properly displayed in DomainAdminsSettingsPage via OfflineWithFeedback, there's no RBR indicator on the parent page to lead users there.

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

    Add a red DotIndicator next to the Settings button when settings errors exist, following the same pattern used in DomainsListRow.

    In DomainAdminsPage.tsx:

    1. Add necessary imports and compute hasSettingsErrors:
    import {View} from 'react-native';
    import Icon from '@components/Icon';
    import useTheme from '@hooks/useTheme';
    import {isEmptyObject} from '@src/types/utils/EmptyObject';
    
    // Inside component:
    const theme = useTheme();
    const icons = useMemoizedLazyExpensifyIcons(['Gear', 'Plus', 'DotIndicator']);
    
    const hasSettingsErrors = !isEmptyObject(domainErrors?.technicalContactEmailErrors) || 
                              !isEmptyObject(domainErrors?.useTechnicalContactBillingCardErrors);
    1. Wrap the Settings button with a View and conditionally render the RBR indicator:
    <View style={[styles.flexRow, styles.alignItemsCenter, shouldUseNarrowLayout && styles.flexGrow1]}>
        <Button
            onPress={() => Navigation.navigate(ROUTES.DOMAIN_ADMINS_SETTINGS.getRoute(domainAccountID))}
            text={translate('domain.admins.settings')}
            icon={icons.Gear}
            innerStyles={[shouldUseNarrowLayout && styles.alignItemsCenter]}
            style={[shouldUseNarrowLayout && [styles.flexGrow1, styles.mb3]]}
        />
        {hasSettingsErrors && (
            <View style={[styles.ml2]}>
                <Icon
                    src={icons.DotIndicator}
                    fill={theme.danger}
                />
            </View>
        )}
    </View>

    What alternative solutions did you explore? (Optional)

    N/A

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 23, 2026
  5. changed the title [-]Domains - No RBR error on the Domain Admins page when changing primary contact fails[/-] [+][$250] Domains - No RBR error on the Domain Admins page when changing primary contact fails[/+] on Jan 23, 2026
  6. melvin-bot commented on Jan 23, 2026

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 23, 2026
  8. melvin-bot commented on Jan 23, 2026

    @melvin-bot

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

  9. CortneyOfstad commented on Jan 23, 2026

    @CortneyOfstad
    Contributor

    Hey @shubham1206agra! There is a proposal above for review – thanks!

  10. HiepPP commented on Jan 23, 2026

    @HiepPP
    Contributor

    Proposal for Issue #80206

    Problem

    When changing the primary contact on the Domain Admins Settings page fails (e.g., due to network failure), no RBR error indicator appears on the Domain Admins page to guide users to the Settings RHP where the actual error is displayed.

    Root Cause

    The DomainAdminsPage subscribes to domainErrors from Onyx but only uses adminErrors for displaying errors on admin list items. The Settings button does not check for or display errors from technicalContactEmailErrors or useTechnicalContactBillingCardErrors.

    While errors are properly displayed in DomainAdminsSettingsPage via OfflineWithFeedback, there's no RBR indicator on the parent page to lead users there.

    Key code paths:

    • src/pages/domain/Admins/DomainAdminsPage.tsx:35-42 - domainErrors and domainPendingAction are fetched but not fully utilized
    • src/pages/domain/Admins/DomainAdminsPage.tsx:77-83 - Settings button lacks error indicator
    • src/pages/domain/Admins/DomainAdminsSettingsPage.tsx:58-70 - Errors displayed correctly in Settings
    • src/components/Domain/DomainsListRow.tsx:65-71 - Reference pattern for DotIndicator usage

    Solution

    Add a red DotIndicator next to the Settings button when settings errors exist, following the same pattern used in DomainsListRow.

    Implementation

    Files Modified

    src/pages/domain/Admins/DomainAdminsPage.tsx

    Step 1: Add necessary imports

    Add these imports after line 18:

    import {View} from 'react-native';
    import Icon from '@components/Icon';
    import useTheme from '@hooks/useTheme';
    import {isEmptyObject} from '@src/types/utils/EmptyObject';

    Step 2: Add DotIndicator to icons and initialize theme

    Replace line 27 with:

    const icons = useMemoizedLazyExpensifyIcons(['Gear', 'Plus', 'DotIndicator']);

    Add after line 29 (after const styles = useThemeStyles();):

    const theme = useTheme();

    Step 3: Compute hasSettingsErrors

    Add after line 42 (after the domainPendingAction selector):

    const hasSettingsErrors = !isEmptyObject(domainErrors?.technicalContactEmailErrors) ||
                              !isEmptyObject(domainErrors?.useTechnicalContactBillingCardErrors);

    Step 4: Wrap Settings button with error indicator

    Replace the Settings button (lines 77-83) with:

    <View style={[styles.flexRow, styles.alignItemsCenter, shouldUseNarrowLayout && styles.flexGrow1]}>
        <Button
            onPress={() => Navigation.navigate(ROUTES.DOMAIN_ADMINS_SETTINGS.getRoute(domainAccountID))}
            text={translate('domain.admins.settings')}
            icon={icons.Gear}
            innerStyles={[shouldUseNarrowLayout && styles.alignItemsCenter]}
            style={[shouldUseNarrowLayout && [styles.flexGrow1, styles.mb3]]}
        />
        {hasSettingsErrors && (
            <View style={[styles.ml2]}>
                <Icon
                    src={icons.DotIndicator}
                    fill={theme.danger}
                />
            </View>
        )}
    </View>

    Complete Modified Section

    Here's the complete modified DomainAdminsPage.tsx with all changes integrated:

    // ... existing imports ...
    import {View} from 'react-native';
    import Icon from '@components/Icon';
    import useTheme from '@hooks/useTheme';
    import {isEmptyObject} from '@src/types/utils/EmptyObject';
    // ... rest of imports ...
    
    function DomainAdminsPage({route}: DomainAdminsPageProps) {
        const {domainAccountID} = route.params;
        const {translate} = useLocalize();
        const styles = useThemeStyles();
        const {shouldUseNarrowLayout} = useResponsiveLayout();
        const illustrations = useMemoizedLazyIllustrations(['UserShield']);
        const icons = useMemoizedLazyExpensifyIcons(['Gear', 'Plus', 'DotIndicator']);
        const theme = useTheme();
    
        const [adminAccountIDs] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN}${domainAccountID}`, {
            canBeMissing: true,
            selector: adminAccountIDsSelector,
        });
    
        const [domainErrors] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`, {
            canBeMissing: true,
        });
    
        const [domainPendingAction] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS}${domainAccountID}`, {
            canBeMissing: true,
            selector: adminPendingActionSelector,
        });
    
        const hasSettingsErrors = !isEmptyObject(domainErrors?.technicalContactEmailErrors) ||
                                  !isEmptyObject(domainErrors?.useTechnicalContactBillingCardErrors);
    
        // ... rest of component ...
    
        const headerContent = isAdmin ? (
            <>
                <Button
                    success
                    onPress={() => Navigation.navigate(ROUTES.DOMAIN_ADD_ADMIN.getRoute(domainAccountID))}
                    text={translate('domain.admins.addAdmin')}
                    icon={icons.Plus}
                    innerStyles={[shouldUseNarrowLayout && styles.alignItemsCenter]}
                    style={shouldUseNarrowLayout && [styles.flexGrow1, styles.mb3]}
                />
                <View style={[styles.flexRow, styles.alignItemsCenter, shouldUseNarrowLayout && styles.flexGrow1]}>
                    <Button
                        onPress={() => Navigation.navigate(ROUTES.DOMAIN_ADMINS_SETTINGS.getRoute(domainAccountID))}
                        text={translate('domain.admins.settings')}
                        icon={icons.Gear}
                        innerStyles={[shouldUseNarrowLayout && styles.alignItemsCenter]}
                        style={[shouldUseNarrowLayout && [styles.flexGrow1, styles.mb3]]}
                    />
                    {hasSettingsErrors && (
                        <View style={[styles.ml2]}>
                            <Icon
                                src={icons.DotIndicator}
                                fill={theme.danger}
                            />
                        </View>
                    )}
                </View>
            </>
        ) : null;
    
        // ... rest unchanged ...
    }

    Testing Approach

    1. Enable "Simulate failing network requests" via CMD+D
    2. Navigate to Workspaces -> Domain -> Domain Admins
    3. Tap Settings button
    4. Tap "Primary contact"
    5. Select a different contact
    6. Close the RHP (navigate back to Domain Admins page)
    7. Verify: Red dot indicator appears next to Settings button
    8. Tap Settings button again
    9. Verify: Error message is visible on Primary contact row
    10. Disable network failure simulation
    11. Verify: Dot indicator disappears when errors clear

    Expected Behavior

    • When technicalContactEmailErrors or useTechnicalContactBillingCardErrors exist, a red dot appears next to the Settings button
    • Clicking Settings navigates to the Settings page where the full error message is displayed
    • The dot disappears when errors are cleared
    • Works in both narrow (mobile) and wide (desktop) layouts

    Alternatives Considered

    Alternative 1: Full-page error banner

    Display a large error banner at the top of the Domain Admins page.
    Rejected: Too invasive for this use case; the dot indicator pattern is already established in the codebase.

    Alternative 2: Error toast notification

    Show a toast message when the user returns to the page.
    Rejected: Toasts are transient and don't persist to guide users to the error location.

    Alternative 3: Modal error dialog

    Display a modal when errors are detected.
    Rejected: Modals interrupt user flow and are inconsistent with existing RBR patterns.

    References

  11. shubham1206agra commented on Jan 25, 2026

    @shubham1206agra
    Contributor

    @situchan and @war-in should take over this as a regression.

  12. situchan commented on Jan 25, 2026

    @situchan
    Contributor

    yes assignment here @mountiny

  13. 19 remaining items

  14. dannymcclain commented on Feb 2, 2026

    @dannymcclain
    Contributor

    Yeah I don't mind what you have there - would it be the worst to add the red dot to the right side of the button (like where a dropdown caret would go) and leave the settings icon? (Might look wacky)

  15. shawnborton commented on Feb 2, 2026

    @shawnborton
    Contributor

    Does feel a little whacky I must say, but here it is:

    Image
  16. shawnborton commented on Feb 2, 2026

    @shawnborton
    Contributor

    We could do something more custom like this:

    Image

    But part of me thinks just replacing the icon with a left red dot would do the trick just fine?

  17. dannymcclain commented on Feb 2, 2026

    @dannymcclain
    Contributor

    Yeah I'm with you—I actually don't hate having it on the right, it feels pretty clear to me, but I agree it looks better if we just replace the left icon. (And yeah, I don't really wanna do a custom button + dot thing here like that Figma screenshot haha)

  18. added
    ReviewingHas a PR in review
    and removed on Feb 2, 2026
  19. dubielzyk-expensify commented on Feb 3, 2026

    @dubielzyk-expensify
    Contributor

    Yeah I also don't mind either replacing the cog or the right dot treatment

  20. shawnborton commented on Feb 3, 2026

    @shawnborton
    Contributor

    Sweet sounds good to me, I say we go with the left icon replacement idea for now. @mountiny holler if you need anything else.

  21. mountiny commented on Feb 4, 2026

    @mountiny
    Contributor

    Perfect, thank you!

  22. melvin-bot commented on Mar 5, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @shawnborton, @CortneyOfstad, @mountiny, @war-in, @situchan 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!

  23. mountiny commented on Mar 5, 2026

    @mountiny
    Contributor

    This was fixed and payment is handled as part of project

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DesignExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2ReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions