App icon indicating copy to clipboard operation
App copied to clipboard

[$250] The tab bar does not visible above the spinner

Open applause-bot[bot] opened this issue 1 month ago • 63 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.7-3 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://github.com/Expensify/App/pull/103421 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: IPHONE 12 / IOS 26.3.1 App Component: Money Requests

Action Performed:

Prerequisite: an account that is a member of at least two workspaces with Per diem enabled (Workspace > More features > Per diem), each with at least one per diem rate. Import per diem sheet on web so that on Android it does not preload. Change network connectivity to 3G

  1. Open App
  2. Tap on FAB > Create expense
  3. Tap on per diem tab > select WS

Expected Result:

The "Create expense" header and the tab bar stay visible above the spinner. No extra "Go back" button appears under the header.

Actual Result:

The tab bar is not visible above the spinner. Extra Go back "<" button appears under the header.

Workaround:

Unknown

Platforms:

  • [x] Android: App
  • [ ] Android: mWeb Chrome
  • [x] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [ ] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

https://github.com/user-attachments/assets/e7123d58-4516-4f2c-8129-751e10e6c108

View all open jobs on GitHub

Applause Internal Information Exported by: Julia Ponikarchuk Bug ID: 7283446

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @sobitneupane

applause-bot[bot] avatar Oct 13 '26 08:10 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/8931b7579708cca9017615b114ccd2881888636c1aede5ffc773291e81852641

applause-bot[bot] avatar Oct 13 '26 08:10 applause-bot[bot]

This PR failing because of the issue #103838 This issue is reproducible in: Web, Android app

Self-assigning to investigate as the issue failing the PR I worked on.

situchan avatar Oct 13 '26 08:10 situchan

Proposal

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

On the Per diem tab, picking a workspace whose per diem rates are not loaded yet shows a spinner on a new screen. That screen has its own "Create expense" header with a < back button and no tab bar.

What is the root cause of that problem?

After you pick a workspace, selectWorkspace only waits in the tab when the destination cannot resolve the policy. The workspace chat always has a real policyID, so it skips the wait and opens the Destination step right away, before the rates arrive (IOURequestStepPerDiemWorkspace.tsx:73-99).

The Destination step is a separate screen with its own header and back button. It shows a spinner until the rates load (DynamicIOURequestStepDestination.tsx:236-248). That screen is what QA sees.

Use ActivityIndicator inside the Per Diem tab while the selected workspace loads is in 9.5.7-3, but it only changed the in-tab loader (IOURequestStepPerDiemWorkspace.tsx:111-120). This flow never reaches that loader. So this is older behavior, not a regression from that PR.

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

In selectWorkspace, wait in the tab whenever the per diem custom unit is missing, not only when the policy can't be resolved:

  1. If there is no per diem unit, call fetchPerDiemRates, set pendingPolicyID, and return.
  2. The existing effect at IOURequestStepPerDiemWorkspace.tsx:102-109 already calls selectWorkspace again once the unit loads. It then opens Destination with the rates ready.

The user then sees the in-tab spinner, and the header and tab bar stay visible. Add a unit test: given a workspace with no per diem unit, selecting it does not navigate and shows the in-tab loader.

What alternative solutions did you explore? (Optional)

  • Gate on perDiemUnit?.rates instead of the unit itself, to match the Destination step's isLoading check. This also covers the case where the unit arrives before its rates. If you choose this, update the effect's condition the same way.
  • Keep the current navigation and treat the Destination screen's loader as expected. That would mean closing this issue as expected behavior.
Investigation details
  • The tested build includes the fix: the 9.5.7-3-staging tag contains the PR's merge commit, and the file at that tag uses the new ActivityIndicator wrapper.
  • styles.fullScreenLoading has no absolute positioning (styles/index.ts:3647-3653), so the in-tab loader can't cover the tab bar.
  • The < comes from StepScreenWrapper's HeaderWithBackButton, which shows because openedFromStartPage is false on the pushed screen (StepScreenWrapper.tsx:66-88). It does not come from FullScreenLoadingIndicator, whose Go back control is a text button that appears after a timeout.
  • With only one per diem workspace, the Destination step renders inside the tab, so the tab bar stays (IOURequestStartPage.tsx:355-371). The bug needs two or more per diem workspaces, which matches the prerequisite.
  • I confirmed this by reading the code. I did not reproduce it on a device.

Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/103838) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.

MelvinBot avatar Oct 13 '26 08:10 MelvinBot

Current assignee @situchan is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] avatar Oct 13 '26 08:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022109928824204193624

melvin-bot[bot] avatar Oct 13 '26 08:10 melvin-bot[bot]

Proposal

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

When selecting a workspace on the Per Diem tab where per diem rates have not yet loaded, the app navigates immediately to a separate Destination screen that displays a full-screen spinner with a header back arrow, completely hiding the tab bar.

What is the root cause of that problem?

In src/pages/iou/request/step/IOURequestStepPerDiemWorkspace.tsx:70-75:

const canDestinationResolvePolicy = !!perDiemUnit || (!!targetReport.policyID && targetReport.policyID !== CONST.POLICY.ID_FAKE);
if (!canDestinationResolvePolicy) {
    setPendingPolicyID(policy?.id);
    return;
}
  1. Premature Navigation via Short-Circuiting: For any standard policy expense chat, targetReport.policyID is valid (not CONST.POLICY.ID_FAKE). Therefore, canDestinationResolvePolicy evaluates to true even when perDiemUnit is completely undefined and its rates have not arrived yet. As a result, selectWorkspace skips the in-tab pending state (pendingPolicyID) and immediately calls:

    Navigation.navigate(
        createDynamicRoute(DYNAMIC_ROUTES.MONEY_REQUEST_STEP_DESTINATION.path, ROUTES.MONEY_REQUEST_CREATE.getRoute(action, targetIouType, transactionID, targetReport.reportID)),
    );
    
  2. Destination Step Full-Screen Loading: Once navigated to DynamicIOURequestStepDestination.tsx, because per diem rates are still missing, DynamicIOURequestStepDestination renders its own FullScreenLoadingIndicator inside a pushed StepScreenWrapper. This pushed screen has its own header back button (<) and is outside the tab navigator, causing the tab bar to disappear while loading.

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

  1. Gate Destination Navigation on Per Diem Unit / Rates Resolution: In src/pages/iou/request/step/IOURequestStepPerDiemWorkspace.tsx: Require the per diem custom unit to be loaded before navigating away from the workspace selection step:

    -const canDestinationResolvePolicy = !!perDiemUnit || (!!targetReport.policyID && targetReport.policyID !== CONST.POLICY.ID_FAKE);
    +const canDestinationResolvePolicy = !!perDiemUnit && (!!targetReport.policyID && targetReport.policyID !== CONST.POLICY.ID_FAKE);
     if (!canDestinationResolvePolicy) {
         setPendingPolicyID(policy?.id);
         return;
     }
    

    Or explicitly check if (!perDiemUnit) { setPendingPolicyID(policy?.id); return; }.

  2. In-Tab Loading Indicator: When pendingPolicyID is set, render the in-tab activity indicator within the tab container (preserving the tab bar and header) rather than pushing a new screen. The existing useEffect in lines 99-106 will then cleanly fire selectWorkspace(pendingPolicy) once pendingPolicy receives perDiemUnit via Onyx, smoothly transitioning to Destination with rates already available.

What alternative solutions did you explore? (Optional)

  • Gating inside DynamicIOURequestStepDestination.tsx: Not recommended, because navigating to a pushed screen only to show a spinner defeats the purpose of keeping tab navigation visible.

What specific scenarios should we cover in automated tests?

In tests/unit/IOURequestStepPerDiemWorkspaceTest.tsx:

  1. Render IOURequestStepPerDiemWorkspace with multiple workspaces where the selected workspace has not yet cached per diem custom units.
  2. Verify that clicking the workspace sets pendingPolicyID and keeps the user on the workspace step without firing navigation.
  3. Simulate Onyx updating with the policy's per diem custom unit and assert navigation to MONEY_REQUEST_STEP_DESTINATION is triggered with the tab bar preserved up until navigation.

jloa-dev avatar Oct 13 '26 14:10 jloa-dev

Hi @situchan, contributor details for the proposal above:

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa

jloa-dev avatar Oct 13 '26 21:10 jloa-dev

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 13 '26 21:10 melvin-bot[bot]

@situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Oct 16 '26 21:10 melvin-bot[bot]

@situchan Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] avatar Oct 20 '26 21:10 melvin-bot[bot]

@situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] avatar Oct 22 '26 21:10 melvin-bot[bot]

@situchan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Oct 27 '26 21:10 melvin-bot[bot]

@situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Oct 28 '26 21:10 melvin-bot[bot]

@situchan Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Oct 30 '26 21:10 melvin-bot[bot]

@situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] avatar Nov 03 '26 23:11 melvin-bot[bot]

@situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] avatar Nov 04 '26 02:11 melvin-bot[bot]

@situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] avatar Nov 04 '26 03:11 melvin-bot[bot]

This PR failing because of the issue #103838 This issue is reproducible in: Android and iOS app

I confirmed #103838 is not the offending PR. Still reproducible after revert

situchan avatar Nov 04 '26 21:11 situchan

@MelvinBot implement your proposal for testing

situchan avatar Nov 04 '26 21:11 situchan

🤖 Web test steps verification results: ⚠️ partial

Tested unchanged code on dev NewDot web; no implementation or code changes were made because this run permits verification only. Create expense opened, but the required Per diem loading scenario could not be established.

Create expense opened with location-access dialog
Step Status
Open AppAuthenticated Home screen appeared.
✅
Open FAB > Create expenseCreate expense opened with Manual and Scan tabs. A location-access dialog then appeared.
Create expense opened with location-access dialog
✅
Select Per diem and a workspace with uncached ratesBlocked: two workspaces with Per diem enabled and rates were not established. Only Manual and Scan tabs appeared; automation could not dismiss the location dialog.
⚠️
Header and tabs remain visible without an extra back arrow while rates loadUnverified: the Per diem loading state was not reached.
⚠️

MelvinBot avatar Nov 04 '26 21:11 MelvinBot