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

Start chat - App crashes when pressing keyboard up key in Start chat list #40401

Closed
2 of 6 tasks
izarutskaya opened this issue Apr 18, 2024 · 12 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@izarutskaya
Copy link

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: 1.4.63-0
Reproducible in staging?: Y
Reproducible in production?: N
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Start chat.
  3. Press keyboard down key.
  4. Press keyboard up key.

Expected Result:

App does not crash.

Actual Result:

App crashes.

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

Bug6453279_1713425262908.keyboard_crash.mp4

Bug6453279_1713425262915!crash.txt

View all open jobs on GitHub

@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

Copy link

melvin-bot bot commented Apr 18, 2024

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

@izarutskaya
Copy link
Author

@anmurali 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.

@izarutskaya
Copy link
Author

We think this issue might be related to the #collect project.

@izarutskaya
Copy link
Author

Production

bandicam.2024-04-18.10-55-11-411.mp4

@ShridharGoel
Copy link
Contributor

ShridharGoel commented Apr 18, 2024

Proposal

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

App crashes on cyclic traversal in big lists.

What is the root cause of that problem?

This happens only for big lists because the whole list is not loaded when the user tries to go to the bottom most item.

This started happening since #39201 because the below logic was added.

// If `initiallyFocusedOptionKey` is not passed, we fall back to `-1`, to avoid showing the highlight on the first member
const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({
initialFocusedIndex: flattenedSections.allOptions.findIndex((option) => option.keyForList === initiallyFocusedOptionKey),
maxIndex: flattenedSections.allOptions.length - 1,
isActive: true,
onFocusedIndexChange: (index: number) => {
scrollToIndex(index, true);
},
isFocused,
});

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

We should use cyclic traversal only when length of list <= 500 (because we show 500 items at the start, along with a "Show more" option at the bottom).

We can add disableCyclicTraversal: flattenedSections.allOptions.length > 500 in the below:

const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({
        initialFocusedIndex: flattenedSections.allOptions.findIndex((option) => option.keyForList === initiallyFocusedOptionKey),
        maxIndex: flattenedSections.allOptions.length - 1,
        isActive: true,
        disableCyclicTraversal: flattenedSections.allOptions.length > 500,
        onFocusedIndexChange: (index: number) => {
            scrollToIndex(index, true);
        },
        isFocused,
    });

This is in BaseSelectionList.

We can check for a similar issue in BaseOptionsList and update there as well.

@danieldoglas
Copy link
Contributor

@ShridharGoel thanks for pointing out where the issue came from. Your proposal was great, but in cases like this (where the issue was caused by a PR that was recently deployed < 7 days ago), it is expected that the contributor who originally did the changes fixes the regressions as part of the original issue. I suggest you look for issues that have Help Wanted labels, where you would be assigned to a situation like this.

@WojtekBoman this is a regression from your PR that was merged deployed 7h ago. Please look into it as well!

cc @roryabraham

@WojtekBoman
Copy link
Contributor

I'll prepare a fix for that

@WojtekBoman
Copy link
Contributor

The PR with the fix for this issue is ready for review

@roryabraham
Copy link
Contributor

fix is being CP'd here

@roryabraham
Copy link
Contributor

confirmed this is fixed on staging, no payments due, closing this out

@roryabraham roryabraham removed the DeployBlockerCash This issue or pull request should block deployment label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants