Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

Book travel -App reopens company address page instead of T&C page after saving company address #49870

Closed lanitochka17 closed 1 month ago

lanitochka17 commented 1 month ago

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.0.41-1 Reproducible in staging?: Y Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): applausetester+salalalala@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Open FAB > Book travel
  3. Click Book travel
  4. Select address and save it
  5. Click Book travel

Expected Result:

App will redirect to T&C page

Actual Result:

App reopens company address page

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/59929539-6eb7-4585-bcc7-122c842c3db5

View all open jobs on GitHub

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @AndrewGable (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

github-actions[bot] commented 1 month ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
lanitochka17 commented 1 month ago

We think that this bug might be related to #vip-travel

ishpaul777 commented 1 month ago

Most probably coming from this one -> https://github.com/Expensify/App/pull/48060/files

Nodebrute commented 1 month ago

Proposal

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

App reopens company address page instead of T&C page after saving company address

What is the root cause of that problem?

We are checking for isEmptyObject(travelSettings) https://github.com/Expensify/App/blob/71db3f19691069182447b6b1b9fff62ec93be86c/src/libs/TripReservationUtils.ts#L81-L83

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

We should check if !hasPolicyAddress only then we should navigate to address page https://github.com/Expensify/App/blob/71db3f19691069182447b6b1b9fff62ec93be86c/src/libs/TripReservationUtils.ts#L81-L83

    const hasPolicyAddress = !isEmptyObject(policy?.address);
   if (!hasPolicyAddress) {
        Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(activePolicyID ?? '-1', Navigation.getActiveRoute()));
        return;
    }

We can pass policy to this function

What alternative solutions did you explore? (Optional)

AndrewGable commented 1 month ago

cc @daledah @luacmartins @DylanDylann

daledah commented 1 month ago

@AndrewGable Here's the follow-up PR

roryabraham commented 1 month ago

Book Travel is behind a beta - not sure if it needs to be a blocker but the solution looks simple. Looks like we have a good number of customers on the beta, so if we can fix it that'd probably be best.

luacmartins commented 1 month ago

Fixed in staging. Closing.