Skip to content

[Due for payment 2026-01-23] [$250] Travel - User without verification can trigger “Request Sent” state on Travel page #78750

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: v9.2.90-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: https://test-management.browserstack.com/projects/2219752/test-runs/TR-2597/folder/13177079/41237920/1101375175
Email or phone of affected tester (no customers): luongvu92@private.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 10/Chrome
App Component: Workspace Settings

Action Performed:

  1. Sign up for a new account in NewDot with a private domain account (Don't validate the account)
  2. Finish the onboarding with 1-10 members
  3. Navigate to the Workspace features
  4. Toggle on the Travel
  5. Click on the Travel -> Let's Go button
  6. Click back on the RHP without entering the magic code

Expected Result:

The Let's go button is in the same status because the account isn't verified yet

Actual Result:

The Let's go button changed status to Request sent

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/~022006670805403073426
  • Upwork Job ID: 2006670805403073426
  • Last Price Increase: 2026-01-01
  • Automatic offers:
    • situchan | Reviewer | 110019120
Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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. TaduJR commented on Jan 1, 2026

    @TaduJR
    Contributor

    Proposal

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

    When a user without account verification clicks "Let's Go" on the Travel page, navigates to the verification page, then clicks back without entering the magic code, the button state incorrectly changes to "Request Sent".

    What is the root cause of that problem?

    The handleClose callback in VerifyAccountPage.tsx unconditionally calls requestTravelAccess() when the page closes, regardless of whether the user actually completed verification.

    Root Cause Flow Analysis

    1. User clicks "Let's Go" button which triggers bookATrip():

    } else if (!isBetaEnabled(CONST.BETAS.IS_TRAVEL_VERIFIED)) {
    if (!isUserValidated) {
    Navigation.navigate(ROUTES.TRAVEL_VERIFY_ACCOUNT.getRoute(undefined, activePolicyID, Navigation.getActiveRoute()));
    return;
    }

    1. Since user is not validated, they're navigated to VerifyAccountPage:

    function VerifyAccountPage({route}: VerifyAccountPageProps) {
    const {domain, backTo, policyID} = route.params;
    const [travelProvisioning] = useOnyx(ONYXKEYS.TRAVEL_PROVISIONING, {canBeMissing: true});
    const {isBetaEnabled} = usePermissions();
    useEffect(() => {
    return () => {
    setTravelProvisioningNextStep();
    };
    }, []);
    const isTravelVerifiedBetaEnabled = isBetaEnabled(CONST.BETAS.IS_TRAVEL_VERIFIED);
    // Determine where to navigate after successful OTP validation
    const navigateForwardTo = isTravelVerifiedBetaEnabled ? (travelProvisioning?.nextStepRoute ?? ROUTES.TRAVEL_TCS.getRoute(domain ?? '', policyID)) : undefined;
    const handleClose = useCallback(() => {
    requestTravelAccess();
    Navigation.goBack(backTo);
    }, [backTo]);
    return (
    <VerifyAccountPageBase
    navigateBackTo={backTo}
    navigateForwardTo={navigateForwardTo}
    handleClose={!isTravelVerifiedBetaEnabled ? handleClose : undefined}
    />
    );
    }
    export default VerifyAccountPage;

    1. The handleClose callback unconditionally calls requestTravelAccess():

    const handleClose = useCallback(() => {
    requestTravelAccess();
    Navigation.goBack(backTo);
    }, [backTo]);

    1. When user clicks back button, handleCloseWithFallback triggers the custom handleClose:

    const handleCloseWithFallback = useCallback(() => {
    if (handleClose) {
    handleClose();
    return;
    }
    Navigation.goBack(navigateBackTo);
    }, [handleClose, navigateBackTo]);

    1. requestTravelAccess() sets lastTravelSignupRequestTime in Onyx:

    {
    onyxMethod: 'merge',
    key: ONYXKEYS.TRAVEL_PROVISIONING,
    value: {
    isLoading: false,
    errors: getMicroSecondOnyxErrorWithTranslationKey('travel.errorMessage'),
    },
    },
    ];
    const params: AcceptSpotnanaTermsParams = {domain, policyID};
    // We need to call this API immediately to get the response and open the travel page.
    // See https://github.com/Expensify/App/pull/69769#discussion_r2368967354 for more info.

    1. getTravelStep() returns REVIEWING_REQUEST when lastTravelSignupRequestTime exists:

    App/src/libs/PolicyUtils.ts

    Lines 1683 to 1685 in 66de3d6

    return CONST.TRAVEL.STEPS.BOOK_OR_MANAGE_YOUR_TRIP;
    }
    if (!isTravelVerifiedBetaEnabled && travelSettings?.lastTravelSignupRequestTime) {

    The problem is that handleClose is called both when user dismisses/goes back AND when they successfully validate, but it doesn't distinguish between these two cases.

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

    Add an onValidationSuccess callback prop to VerifyAccountPageBase that is called ONLY when the user successfully validates their account. This separates the success path from the dismiss/back path.

    Solution

    1. Add onValidationSuccess prop to VerifyAccountPageBase:

    type VerifyAccountPageBaseProps = {navigateBackTo?: Route; navigateForwardTo?: Route; handleClose?: () => void};

    -type VerifyAccountPageBaseProps = {navigateBackTo?: Route; navigateForwardTo?: Route; handleClose?: () => void};
    +type VerifyAccountPageBaseProps = {
    +    navigateBackTo?: Route;
    +    navigateForwardTo?: Route;
    +    handleClose?: () => void;
    +    /** Callback called ONLY when user successfully validates their account (not on dismiss/back) */
    +    onValidationSuccess?: () => void;
    +};
    1. Call onValidationSuccess in the validation useEffect before navigation:

    useEffect(() => {
    if (!isUserValidated) {
    return;
    }
    if (navigateForwardTo) {
    Navigation.navigate(navigateForwardTo, {forceReplace: true});
    } else {
    handleCloseWithFallback();
    }
    }, [isUserValidated, navigateForwardTo, handleCloseWithFallback, handleClose]);

     useEffect(() => {
         if (!isUserValidated) {
             return;
         }
    +    // Call the success callback ONLY when user successfully validates
    +    onValidationSuccess?.();
    +
         if (navigateForwardTo) {
             Navigation.navigate(navigateForwardTo, {forceReplace: true});
         } else {
             handleCloseWithFallback();
         }
    -}, [isUserValidated, navigateForwardTo, handleCloseWithFallback, handleClose]);
    +}, [isUserValidated, navigateForwardTo, handleCloseWithFallback, handleClose, onValidationSuccess]);
    1. Update VerifyAccountPage.tsx to use onValidationSuccess and remove requestTravelAccess() from handleClose:

    const handleClose = useCallback(() => {
    requestTravelAccess();
    Navigation.goBack(backTo);
    }, [backTo]);

    +const handleValidationSuccess = useCallback(() => {
    +    requestTravelAccess();
    +}, []);
    +
     const handleClose = useCallback(() => {
    -    requestTravelAccess();
         Navigation.goBack(backTo);
     }, [backTo]);
    
     return (
         <VerifyAccountPageBase
             navigateBackTo={backTo}
             navigateForwardTo={navigateForwardTo}
             handleClose={!isTravelVerifiedBetaEnabled ? handleClose : undefined}
    +        onValidationSuccess={!isTravelVerifiedBetaEnabled ? handleValidationSuccess : undefined}
         />
     );

    This ensures:

    • handleClose → navigation only (dismiss/back)
    • onValidationSuccess → business logic triggered on actual validation success
  4. ShridharGoel commented on Jan 1, 2026

    @ShridharGoel
    Contributor

    Proposal

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

    Travel - User without verification can trigger “Request Sent” state on Travel page.

    What is the root cause of that problem?

    The Travel verify account page always calls requestTravelAccess when the user closes the OTP flow, no matter whether the account is validated. That writes lastTravelSignupRequestTime and moves the workspace into the “Reviewing request” state.

    function VerifyAccountPage({route}: VerifyAccountPageProps) {
    const {domain, backTo, policyID} = route.params;
    const [travelProvisioning] = useOnyx(ONYXKEYS.TRAVEL_PROVISIONING, {canBeMissing: true});
    const {isBetaEnabled} = usePermissions();
    useEffect(() => {
    return () => {
    setTravelProvisioningNextStep();
    };
    }, []);
    const isTravelVerifiedBetaEnabled = isBetaEnabled(CONST.BETAS.IS_TRAVEL_VERIFIED);
    // Determine where to navigate after successful OTP validation
    const navigateForwardTo = isTravelVerifiedBetaEnabled ? (travelProvisioning?.nextStepRoute ?? ROUTES.TRAVEL_TCS.getRoute(domain ?? '', policyID)) : undefined;
    const handleClose = useCallback(() => {
    requestTravelAccess();
    Navigation.goBack(backTo);
    }, [backTo]);

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

    • Read the account record inside the Travel verify page and gate the close handler so we only call requestTravelAccess after the account is validated. This keeps the CTA as “Let’s go” until the user finishes OTP.

    Updated code snippet:

    function VerifyAccountPage({route}: VerifyAccountPageProps) {
        const {domain, backTo, policyID} = route.params;
        const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
        const [travelProvisioning] = useOnyx(ONYXKEYS.TRAVEL_PROVISIONING, {canBeMissing: true});
        const {isBetaEnabled} = usePermissions();
        const isUserValidated = account?.validated ?? false;
        ...
        const handleClose = useCallback(() => {
            if (isUserValidated) {
                requestTravelAccess();
            }
            Navigation.goBack(backTo);
        }, [backTo, isUserValidated]);
        ...
    }
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 1, 2026
  6. changed the title [-]Travel - User without verification can trigger “Request Sent” state on Travel page[/-] [+][$250] Travel - User without verification can trigger “Request Sent” state on Travel page[/+] on Jan 1, 2026
  7. melvin-bot commented on Jan 1, 2026

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 1, 2026
  9. moved this to Bugs and Follow Up Issues in #expensify-bugson Jan 1, 2026
  10. melvin-bot commented on Jan 1, 2026

    @melvin-bot

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

  11. nyomanjyotisa commented on Jan 1, 2026

    @nyomanjyotisa
    Member

    🚨 Edited by proposal-police: This proposal was edited at 2026-01-01 11:18:22 UTC.

    Proposal

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

    Travel - User without verification can trigger "Request Sent" state on Travel page

    What is the root cause of that problem?

    handleClose calls requestTravelAccess when the user navigates back

    const handleClose = useCallback(() => {
    requestTravelAccess();
    Navigation.goBack(backTo);
    }, [backTo]);

    This sets lastTravelSignupRequestTime which then causes getTravelStep to return the REVIEWING_REQUEST step

    App/src/libs/PolicyUtils.ts

    Lines 1685 to 1686 in 66de3d6

    if (!isTravelVerifiedBetaEnabled && travelSettings?.lastTravelSignupRequestTime) {
    return CONST.TRAVEL.STEPS.REVIEWING_REQUEST;

    The request should only be sent when the user is validated and clicks the button, which is already handled in BookTravelButton

    if (!travelSettings?.lastTravelSignupRequestTime) {
    requestTravelAccess();
    }

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

    Remove the requestTravelAccess call from handleClose. If the user verifies, VerifyAccountPageBase navigates forward (handled by its useEffect). If the user goes back without verifying, we should not set the request time

        const handleClose = useCallback(() => {
            Navigation.goBack(backTo);
        }, [backTo]);

    const handleClose = useCallback(() => {
    requestTravelAccess();
    Navigation.goBack(backTo);
    }, [backTo]);

    Then we can add a useEffect that watches for successful verification and sends the request when the user becomes validated (only when the beta is disabled)

        const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
        const [travelSettings] = useOnyx(ONYXKEYS.NVP_TRAVEL_SETTINGS, {canBeMissing: true});
        const isUserValidated = account?.validated ?? false;
    
        useEffect(() => {
            if (!isTravelVerifiedBetaEnabled && isUserValidated && !travelSettings?.lastTravelSignupRequestTime) {
                requestTravelAccess();
            }
        }, [isTravelVerifiedBetaEnabled, isUserValidated, travelSettings?.lastTravelSignupRequestTime]);

    What alternative solutions did you explore? (Optional)

    We could check isUserValidated in handleClose before calling requestTravelAccess

  12. 28 remaining items

  13. melvin-bot commented on Jan 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.3-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-01-23. 🎊

    For reference, here are some details about the assignees on this issue:

  14. melvin-bot commented on Jan 16, 2026

    @melvin-bot

    @situchan @bfitzexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  15. bfitzexpensify commented on Jan 20, 2026

    @bfitzexpensify
    Contributor

    Payment on Friday

  16. bfitzexpensify commented on Jan 26, 2026

    @bfitzexpensify
    Contributor

    Payment summary:

    @situchan owed $250 via Upwork - paid ✅
    @TaduJR owed $250 via Upwork - paid ✅

  17. bfitzexpensify commented on Jan 26, 2026

    @bfitzexpensify
    Contributor

    @situchan please complete the BZ checklist

  18. TaduJR commented on Jan 26, 2026

    @TaduJR
    Contributor

    Offer Accepted @bfitzexpensify

    Thanks!

  19. situchan commented on Jan 26, 2026

    @situchan
    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: https://github.com/Expensify/App/pull/71630/changes#r2726699129

    • [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:

    Regression Test Proposal

    Test:

    1. Sign up for a new account in NewDot with a private domain account (Don't validate the account)
    2. Finish the onboarding with 1-10 members
    3. Navigate to the Workspace features
    4. Toggle on the Travel
    5. Click on the Travel -> Let's Go button
    6. Click back on the RHP without entering the magic code
    7. Verify the Let's go button is in the same status because the account isn't verified yet

    Do we agree 👍 or 👎

  20. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions