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 2025-01-02] Debug Mode - "Create" button flash after creating a violation #53027

Open
2 of 8 tasks
IuliiaHerets opened this issue Nov 23, 2024 · 32 comments
Open
2 of 8 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 23, 2024

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.0.66-0
Reproducible in staging?: Y
Reproducible in production?: Can't check as no Debug Mode on production
Email or phone of affected tester (no customers): dave0123seife@gmail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Enable debug mode in Troubleshoot
  3. Open an expense thread (create one if you don't have any)
  4. Enter debug view then check on "View transaction" tab
  5. Go to "violations" > Create a violation and save it

Expected Result:

"Create" button does not flash after creating a violation

Actual Result:

"Create" button flash after creating a violation

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6673733_1732322393345.Screen_Recording_2024-11-23_at_3.31.20_at_night.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @slafortune
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Nov 23, 2024
Copy link

melvin-bot bot commented Nov 23, 2024

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

Copy link

melvin-bot bot commented Nov 23, 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.

Copy link

melvin-bot bot commented Nov 23, 2024

💬 A slack conversation has been started in #expensify-open-source

@melvin-bot melvin-bot bot added the Daily KSv2 label Nov 23, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Nov 23, 2024
Copy link
Contributor

👋 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.

@DylanDylann
Copy link
Contributor

cc @pac-guerreiro

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Nov 25, 2024
@mountiny
Copy link
Contributor

This is a debug feature only so not a blocker. @DylanDylann @pac-guerreiro please follow up on this one from your PR cc @puneetlath in case you want to take over as a CME too cc @fabioh8010

@pac-guerreiro
Copy link
Contributor

Hi! I’m Pedro Guerreiro from Callstack - expert contributor group. I’d like to work on this task!

@pac-guerreiro
Copy link
Contributor

@IuliiaHerets I wasn't able to reproduce this behaviour on latest main, can you test it again? 😄

Screen.Recording.2024-11-25.at.20.48.16.mp4

@DylanDylann
Copy link
Contributor

I still can reproduce this bug. @pac-guerreiro Could you please try again with some consecutive create?

Screen.Recording.2024-11-26.at.09.52.37.mov

@DylanDylann
Copy link
Contributor

Another bug I see on the debug feature:

Debug.setDebugData(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {[parsedReportAction.reportActionID]: parsedReportAction});

we use the set method but we don't add the previous data. It caused when adding new report action, all previous report actions will be removed

@IuliiaHerets
Copy link
Author

@pac-guerreiro Tester also can still reproduce the issue in the latest build

Screen.Recording.2024-11-26.at.3.26.36.at.night.mp4

@pac-guerreiro
Copy link
Contributor

Another bug I see on the debug feature:

Debug.setDebugData(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {[parsedReportAction.reportActionID]: parsedReportAction});

we use the set method but we don't add the previous data. It caused when adding new report action, all previous report actions will be removed

@DylanDylann nice catch! I think it should be addressed on a separate issue, can you create it?

@pac-guerreiro
Copy link
Contributor

@IuliiaHerets @DylanDylann

I'll try it again, but it's not an easy one 😅 Could you also try creating a report action to confirm if it also happens?

@pac-guerreiro
Copy link
Contributor

Today I didn't have the time to test this again. Tomorrow I'll take another look at it!

@IuliiaHerets
Copy link
Author

@pac-guerreiro Issue is reproducible, build v9.0.67-1

Screen.Recording.2024-11-27.at.1.20.29.at.night.mp4

Copy link

melvin-bot bot commented Dec 2, 2024

@slafortune, @blimpich, @pac-guerreiro, @DylanDylann Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@JKobrynski
Copy link
Contributor

I tried reproducing this issue today and I wasn't able to get it to flash as clearly as it does on the demo, but I think that it flashed for a split second for me 2 or 3 times. I will be taking a look into the code to try to fix that but it might be difficult due to problems with reproduction.

@JKobrynski
Copy link
Contributor

Today I tested a solution which gets rid of the ScrollView that wrapped the FlatList with scrollEnabled={false}, so there is only one scrollable component, I also wrapped renderItem method with useCallback, but none of these solutions fixed that flashing effect.

My plan for the further investigation is to check how this component is rendered in DebugTransactionPage and look for the source of this bug there.

@JKobrynski
Copy link
Contributor

JKobrynski commented Dec 5, 2024

Proposal

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

"Create" button is flashing after creating a new transaction violation in debug mode.

What is the root cause of that problem?

According to my investigation, this is caused by FlatList. Even replacing it with FlashList doesn't help. To me, it looked like FlashList made it occur less often, but I might be wrong, and it doesn't really matter as the bug still reproduces.

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

As the contains a ScrollView that wraps a FlatList with scrollEnabled={false} we can get rid of the FlatList component and replace it with a standard data.map((item) => renderItem(item)) solution. This is not one of the super long and data heavy lists, so removing the non-scrollable FlatList should not impact the performance. I tested this solution and I couldn't reproduce the flashing effect anymore. It was also still as smooth as before.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

  1. FlashList

As mentioned above, I tried replacing FlatList with FlashList but it didn't fix the issue. It seemed to me like the issue happens less often, but it didn't fix it.

  1. Getting rid of ScrollView

This component is quite a small one, and it has a FlatList with scrollEnabled={false} nested right inside a ScrollView. I tried replacing the ScrollView with a View component and enabling scroll on the FlatList. The component looked the same after that change, however the bug still remained unfixed.

  1. useCallback

I thought this flashing effect might be caused by some unnecessary rerender caused by some prop/param update, so I wrapped the renderItem method with useCallback. It also didn't help, the flash was still happening.

@blimpich
Copy link
Contributor

blimpich commented Dec 5, 2024

Weird bug. I'm good with the above solution if we make sure to add a comment explaining why we made the changes we did. Seems like a bug that wouldn't really be able to be prevented with a unit test and also would be easy to forget about and have a regression come up later.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 5, 2024
@JKobrynski
Copy link
Contributor

The PR is ready for review!

@pac-guerreiro
Copy link
Contributor

@DylanDylann @IuliiaHerets I'm back from my vacation, so I'll take it from here 😄

@pac-guerreiro
Copy link
Contributor

I'm able to reproduce this issue on track/submit expense flow as well:

Screen.Recording.2024-12-12.at.14.47.05.mp4

I suspect this issue is caused by OnyxTabNavigator. I just asked internally if someone has experienced this before and can help with it 😄

@pac-guerreiro
Copy link
Contributor

@puneetlath @IuliiaHerets

Last friday (12/13/24)

  • I did some trial and error to understand what could be causing OnyxTabNavigator to re-render the page contents, but I didn't manage to find the cause.

Today:

  • I created my own tab navigator, DebugTabNavigator, which mimics OnyxTabNavigator behaviour and layout but uses a StackNavigator instead of a MaterialTopTabNavigator and it fixes the problem.

@pac-guerreiro
Copy link
Contributor

@puneetlath @IuliiaHerets

Yesterday I addressed the eslint errors on the PR but it seems that they still persist 😅

I'll address them in a moment and let you know!

@pac-guerreiro
Copy link
Contributor

@puneetlath @IuliiaHerets

All remaining issues addressed! Now waiting on @DylanDylann to do his magic 🪄

@pac-guerreiro
Copy link
Contributor

@puneetlath @IuliiaHerets

Today I resolved all conflicts in the PR 😄

@pac-guerreiro
Copy link
Contributor

@puneetlath @IuliiaHerets

Today I fixed the app crash reported by @DylanDylann!

I'll be away until January 2nd but someone should take care of my work 😄 Happy holidays! 🎉

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 26, 2024
@melvin-bot melvin-bot bot changed the title Debug Mode - "Create" button flash after creating a violation [HOLD for payment 2025-01-02] Debug Mode - "Create" button flash after creating a violation Dec 26, 2024
Copy link

melvin-bot bot commented Dec 26, 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 Dec 26, 2024
Copy link

melvin-bot bot commented Dec 26, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 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 2025-01-02. 🎊

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

Copy link

melvin-bot bot commented Dec 26, 2024

@DylanDylann @slafortune @DylanDylann 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]

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. Engineering Weekly KSv2
Projects
Development

No branches or pull requests

7 participants