Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-10-29] [HOLD for payment 2024-10-25] [$250] Android - IOS - It flickers when I open the manual submit expense twice or more #50098

Closed
1 of 6 tasks
IuliiaHerets opened this issue Oct 2, 2024 · 35 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 2, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.43-1
Reproducible in staging?: Y
Reproducible in production?: Y
Issue was found when executing this PR: #49007
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the app
  2. Log in with a Gmail account
  3. Navigate to FAB - Submit expense - Manual
  4. Navigate back to the LHN
  5. Navigate to FAB - Submit expense

Expected Result:

It shouldn't flicker.

Actual Result:

It flickers when I open the manual submit expense twice or more.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6622398_1727890757439.flicker.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021843392417403890622
  • Upwork Job ID: 1843392417403890622
  • Last Price Increase: 2024-10-14
  • Automatic offers:
    • rayane-djouah | Reviewer | 104420246
Issue OwnerCurrent Issue Owner: @slafortune
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 2, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

Triggered auto assignment to @slafortune (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.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@IuliiaHerets
Copy link
Author

@slafortune FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 3, 2024

Proposal

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

  • It flickers when I open the manual submit expense twice or more.

What is the root cause of that problem?

  • In IOURequestStartPage, we display the loading indicator if the transaction data is not available:

return <FullScreenLoadingIndicator />;

  • If the transaction data is loaded successfully, we display the tab navigator:

  • In the tab navigator, we also have logic that will return null if the selectedTab data is loading:

if (isLoadingOnyxValue(selectedTabResult)) {
return null;
}

  • That leads to is flicker effect. The order of displayed components: FullScreenLoadingIndicator > Navigator with 3 tab (Manual | Scan | Distance) > null > Navigator with 3 tab (Manual | Scan | Distance).

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

  • We should display the loading indicator instead of just returning null in:

if (isLoadingOnyxValue(selectedTabResult)) {
return null;
}

Now, the flicker effect still appears. The order of displayed components: FullScreenLoadingIndicator > Navigator with 3 tab (Manual | Scan | Distance) > FullScreenLoadingIndicator > Navigator with 3 tab (Manual | Scan | Distance).

  • We should change the order to: FullScreenLoadingIndicator > Navigator with 3 tab (Manual | Scan | Distance). To do it, we need to remove:

if (!transaction?.transactionID) {
// The draft transaction is initialized only after the component is mounted,
// which will lead to briefly displaying the Not Found page without this loader.
return <FullScreenLoadingIndicator />;
}

and pass isLoading={!transaction?.transactionID} when using OnyxTabNavigator here.

  • In OnyxTabNavigator, update:

if (isLoadingOnyxValue(selectedTabResult)) {
return null;
}

    if (isLoadingOnyxValue(selectedTabResult) || isLoading) {
        return <FullScreenLoadingIndicator />;
    }
  • Beside the above main change, we need to make sure the changes do not break the rest logic in IOURequestStartPage:

<FocusTrapContainerElement
onContainerElementChanged={setActiveTabContainerElement}
style={[styles.flexColumn, styles.flex1]}
>
<IOURequestStepAmount
route={route}
shouldKeepUserInput
/>
</FocusTrapContainerElement>

What alternative solutions did you explore? (Optional)

@bernhardoj
Copy link
Contributor

Proposal

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

The submit expense page flickers when open it.

What is the root cause of that problem?

In submit expense page, we use an OnyxTabNavigator. Inside the component, we return null if the selectedTab onyx data is loading.

if (isLoadingOnyxValue(selectedTabResult)) {
return null;
}

If we already previously loaded the data before, then the tab navigator will be shown immediately. But the navigator has a state listener which is triggered on mount which updates the selectedTab onyx with the same value.

screenListeners={{
state: (e) => {
const event = e as unknown as EventMapCore<NavigationState>['state'];
const state = event.data.state;
const index = state.index;
const routeNames = state.routeNames;
Tab.setSelectedTab(id, routeNames.at(index) as SelectedTabRequest);

It will make the status becomes loading again because now we have a pending merge.
https://github.com/Expensify/react-native-onyx/blob/22b2717e4b6a21b444efe59048ead7cb795b8671/lib/useOnyx.ts#L177-L179

loaded -> loading -> loaded

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

Don't update the onyx if the selected tab is the same.

const newSelectedTab = routeNames.at(index);
if (selectedTab !== newSelectedTab) {
    Tab.setSelectedTab(id, newSelectedTab as SelectedTabRequest);
    onTabSelected(newSelectedTab as IOURequestType);
}

@melvin-bot melvin-bot bot added the Overdue label Oct 4, 2024
@slafortune
Copy link
Contributor

Yep - tested and get the same results 👍

@melvin-bot melvin-bot bot removed the Overdue label Oct 7, 2024
@slafortune slafortune added External Added to denote the issue can be worked on by a contributor Overdue labels Oct 7, 2024
@melvin-bot melvin-bot bot changed the title Android - IOS - It flickers when I open the manual submit expense twice or more [$250] Android - IOS - It flickers when I open the manual submit expense twice or more Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

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

@rayane-djouah
Copy link
Contributor

Reviewing 👀

@rayane-djouah
Copy link
Contributor

@bernhardoj's proposal looks good to me

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 14, 2024

Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Oct 14, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

📣 @rayane-djouah 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Oct 18, 2024
@melvin-bot melvin-bot bot changed the title [$250] Android - IOS - It flickers when I open the manual submit expense twice or more [HOLD for payment 2024-10-25] [$250] Android - IOS - It flickers when I open the manual submit expense twice or more Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-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 2024-10-25. 🎊

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

Copy link

melvin-bot bot commented Oct 18, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@rayane-djouah] The PR that introduced the bug has been identified. Link to the PR:
  • [@rayane-djouah] 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:
  • [@rayane-djouah] A discussion in #expensify-bugs 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:
  • [@rayane-djouah] Determine if we should create a regression test for this bug.
  • [@rayane-djouah] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@rayane-djouah
Copy link
Contributor

BugZero Checklist

  • The PR that introduced the bug has been identified. Link to the PR: fix: default the selected tab to scan #47310
  • 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/47310/files#r1807441500
  • A discussion in #expensify-bugs 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
  • Determine if we should create a regression test for this bug. Yes
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

1. Navigate to FAB > Submit Expense > Manual.
2. Navigate back.
3. Navigate to FAB > Submit Expense again.
4. Expected Result:
5. Verify that the page does not flicker when opening the manual submit expense option multiple times.

Do we agree 👍 or 👎

@marcaaron
Copy link
Contributor

LGTM

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 22, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-10-25] [$250] Android - IOS - It flickers when I open the manual submit expense twice or more [HOLD for payment 2024-10-29] [HOLD for payment 2024-10-25] [$250] Android - IOS - It flickers when I open the manual submit expense twice or more Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.51-4 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 2024-10-29. 🎊

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

Copy link

melvin-bot bot commented Oct 22, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@rayane-djouah] The PR that introduced the bug has been identified. Link to the PR:
  • [@rayane-djouah] 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:
  • [@rayane-djouah] A discussion in #expensify-bugs 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:
  • [@rayane-djouah] Determine if we should create a regression test for this bug.
  • [@rayane-djouah] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@rayane-djouah
Copy link
Contributor

The checklist has already been completed #50098 (comment)

Copy link

melvin-bot bot commented Oct 28, 2024

@slafortune, @marcaaron, @bernhardoj, @rayane-djouah Whoops! This issue is 2 days overdue. Let's get this updated quick!

@marcaaron
Copy link
Contributor

Are we still waiting for payment here?

@bernhardoj
Copy link
Contributor

Yes.

@slafortune
Copy link
Contributor

Payment is due today -
image

@melvin-bot melvin-bot bot removed the Overdue label Oct 29, 2024
@slafortune
Copy link
Contributor

@bernhardoj Role Contributor - requires payment through NewDot Manual Requests - Due $250
@rayane-djouah Role C+ requires payment via Upworks - Paid $250

Copy link

melvin-bot bot commented Oct 29, 2024

@slafortune @marcaaron Be sure to fill out the Contact List!

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: Polish
Development

No branches or pull requests

7 participants