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-06-28] [HOLD for payment 2024-06-28] App crashes when Ctrl/Cmd + D is pressed #43897

Closed
2 of 6 tasks
m-natarajan opened this issue Jun 18, 2024 · 22 comments
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

@m-natarajan
Copy link

m-natarajan commented Jun 18, 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!


issue found when validating #43543
Version Number: 1.4.85-0
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: applause internal team
Slack conversation:

Action Performed:

  1. Sign in to Expensify.
  2. Press Ctrl/Cmd + D.

Expected Result:

Pressing Ctrl/Cmd + D should not cause the app to crash instead it should open the troubleshooting model

Actual Result:

The app crashes when pressing Ctrl/Cmd + D

Workaround:

unknown

Platforms:

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

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

Screenshots/Videos

Bug6516839_1718697002915.Screen_Recording_2024-06-18_at_12.27.46_AM.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @greg-schroeder
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

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

Copy link

melvin-bot bot commented Jun 18, 2024

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

@m-natarajan
Copy link
Author

@greg-schroeder 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

@dangrous
Copy link
Contributor

dangrous commented Jun 18, 2024

This is definitely going to be front end, removing Deploy Blocker label

But it's also not consistently reproducible - for example I just tried it on staging and it crashed the first time, but not after that. Haven't managed to trigger it on local yet.

(That's not saying it's not a bug, it definitely is, but finding the cause will be slightly more challenging)

@dangrous dangrous removed the DeployBlocker Indicates it should block deploying the API label Jun 18, 2024
@dangrous
Copy link
Contributor

dangrous commented Jun 18, 2024

And it's definitely (by default) related to #43543 since that created the shortcut

@dangrous
Copy link
Contributor

I think it's maybe not the shortcut but something to do with opening the separate modal for the options instead of going to the troubleshoot page.

There's nothing in the console, weirdly.

Also after clicking "Refresh" the modal DOES show up, but the slider doesn't work. Again, nothing in the console.

@dominictb
Copy link
Contributor

@dangrous I haven't been able to pinpoint the root cause, but what I saw in the log

image

@dangrous
Copy link
Contributor

oh huh, i wonder why that isn't showing up for me!

I've pinged the folks that worked on the focus trap, hopefully they have some ideas!

@dangrous dangrous mentioned this issue Jun 18, 2024
50 tasks
@dangrous
Copy link
Contributor

OMG I had my console filtered and I didn't realize. I see the error now, hopefully that will help me diagnose.

@dangrous
Copy link
Contributor

Okay! So. I know why it doesn't happen on dev - it's because of

{isDevelopment && <TestToolMenu />}
- if that TestToolMenu isn't there, then it breaks the focus trap, with the error @dominictb noted. Going to ping @adamgrzybowski and @jnowakow here because they might be able to figure out how to fix.

Technically I think this is a regression, as it could have been discovered during testing of #43543, though it is unlikely since it's because of a dev only feature that it works fine. Not sure about official responsibility here but will keep trying to figure it out - all other opinions welcome!

@dangrous
Copy link
Contributor

dangrous commented Jun 19, 2024

Another update, I found this online:

This can happen if there isn't a link/button within the <FocusTrap /> component and there is animations happening that could cause it to not be focusable when the focus trap component mounts.

There's a few solutions here:

1. Default the FocusTrap's active prop to false until the animation is complete
2. Set a fallbackFocus ref via the focusTrapOptions prop

I hope that helps, but let me know if you run into any specific issues with the core HULL components using FocusTrap!

I think it's because the modal is animating in and so there's nothing focusable - it seems like that first option makes the most sense but I'm not sure how to implement... And I don't really know why having or not having the TestToolMenu component in there would make a difference

@Beamanator
Copy link
Contributor

FYI @jnowakow is looking into fixing this one 🙏 - slack thread

@jnowakow
Copy link
Contributor

Yeah, I've found the root cause - it's described here. Focus trap is created before the elements are mounted in dom and this causes the error. The solution is to add fallbackFocus for example to document.body and it prevents the error. I'll open PR in a minute

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jun 19, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Hourly KSv2 labels Jun 19, 2024
@Beamanator
Copy link
Contributor

Merged & CPing PR

@Beamanator Beamanator removed the DeployBlockerCash This issue or pull request should block deployment label Jun 19, 2024
@Beamanator
Copy link
Contributor

Removing deploy blocker b/c this was fixed in staging! I think we can close too, but i'll let @dangrous do that haha

@dangrous
Copy link
Contributor

Okay great! Thanks for the assist @Beamanator. Closing now.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 21, 2024
@melvin-bot melvin-bot bot changed the title App crashes when Ctrl/Cmd + D is pressed [HOLD for payment 2024-06-28] App crashes when Ctrl/Cmd + D is pressed Jun 21, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

Copy link

melvin-bot bot commented Jun 21, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.85-7 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-06-28. 🎊

Copy link

melvin-bot bot commented Jun 21, 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:

  • [@dangrous] The PR that introduced the bug has been identified. Link to the PR:
  • [@dangrous] 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:
  • [@dangrous] 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:
  • [@dangrous] Determine if we should create a regression test for this bug.
  • [@dangrous] 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.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 21, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-28] App crashes when Ctrl/Cmd + D is pressed [HOLD for payment 2024-06-28] [HOLD for payment 2024-06-28] App crashes when Ctrl/Cmd + D is pressed Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.0-9 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-06-28. 🎊

Copy link

melvin-bot bot commented Jun 21, 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:

  • [@dangrous] The PR that introduced the bug has been identified. Link to the PR:
  • [@dangrous] 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:
  • [@dangrous] 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:
  • [@dangrous] Determine if we should create a regression test for this bug.
  • [@dangrous] 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.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

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
None yet
Development

No branches or pull requests

6 participants