Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

CRITICAL: Desktop - Chat Switcher is slow and doesn't recognize keystrokes #28071

Closed kbecciv closed 4 months ago

kbecciv commented 1 year ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Type a message in a chat
  2. Type command+k to open chat switcher
  3. Immediately start typing the name of a person you already have chats with

Expected Result:

The characters you type show up in search

Actual Result:

Many characters are missed. ie. I typed lauren quickly and only the n showed.

Workaround:

Unknown

Platforms:

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

Version Number: 1.3.73.0 Reproducible in staging?: n/a Reproducible in production?: n/a 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 Notes/Photos/Videos: Any additional supporting documentation

n/a

Expensify/Expensify Issue URL: Issue reported by: @mallenexpensify Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695286362554219

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011dba4ca10589e48c
  • Upwork Job ID: 1707643423922569216
  • Last Price Increase: 2023-10-17
Issue OwnerCurrent Issue Owner: @mallenexpensify
mallenexpensify commented 7 months ago

Unsure what's best here. Between chat switcher and the compose box, there seems to be multiple issues with being slow or laggy :/

mallenexpensify commented 7 months ago

Tested again on latest staging version, still happening, regularly missing 1 or 2 keystrokes

image image
mallenexpensify commented 6 months ago

Still a lil slow, I typed lucien here then pressed enter quickly

https://github.com/Expensify/App/assets/22508304/074f163f-58ea-47d2-b9de-a8dd77023223

mallenexpensify commented 6 months ago

We're off hold, Fabric is live and the chat switch is still a lil slow, at least for me. In a few tests I did right now, it was just the first letter that doesn't show, if you type quickly after typing cmd+k in Desktop. @filip-solecki , any thoughts on next best steps here?

filip-solecki commented 6 months ago

I will try to find the root cause and hopefully also some solution in a few days

filip-solecki commented 6 months ago

Hi! Coming back after investigation. The problem is in the BaseSelectionList. In the screenshot I uploaded, you can see that we deliberately delay the focus on the input. This was changed(by removing shouldDelayFocus flag) a long time ago to fix the focus problem when going back to the page with SelectionList. Basically, the only roving we can do in this case is to conditionally bypass setTimeout, in this particular case. It seems that just in this case the error mentioned above should not occur, because from the ChatSwitcher page it is not possible to go anywhere further and then go back to it.

Screenshot 2024-05-17 at 11 01 13

@mallenexpensify

mallenexpensify commented 6 months ago

Thanks @filip-solecki . Does this affect other parts of the app too? I've been noticing that the first character often gets missed. ie. here I typed black and only lack shows.

image
filip-solecki commented 6 months ago

Currently it can occur on every page with SelectionList when you start typing before animation transition is over.

mallenexpensify commented 5 months ago

Thanks @filip-solecki . What do you propose are the next best steps here? (I'm unfamiliar with SelectionList and def not an engineer).

filip-solecki commented 5 months ago

The simplest solution might be to provide an option to bypass the timeout causing missing letters on certain pages where it's possible. This is not a perfect solution since there are pages that need this timeout to prevent previously mentioned bugswhen navigating back.

Another option is to discover an alternate solution for the aforementioned bug. The current timeout is essentially a workaround. If we can find a different approach, we won't need the timeout and the related issue will be eliminated.

mallenexpensify commented 5 months ago

Thanks @filip-solecki. Since this is a part of #newdot-quality and you're a member of the channel, can you start a conversation there about how we want to proceed? With more 👀, we might be able to find a solution that covers all bases. Thx

mallenexpensify commented 5 months ago

@filip-solecki posted in #newdot-quality here. I cross posted to the SWM room to see if any devs could dive in.

Here's the post from Filip

There's an ongoing issue related to the slow Chat Switcher that has existed for quite some time now. From my investigation, it appears that this issue is caused by the BaseSelectionList code fragment(attached). Specifically, the input in the SelectionList (which is implemented in numerous places, for example, the Chat Switcher) grabs focus only after the transition ends, which takes 300 milliseconds. Consequently, this might lead to missing a few characters.

Originally, the delay was incorporated to fix a different problem associated with navigation back to a page embedding a SelectionList.

Currently, we have two potential approaches we can undertake to fix this issue:

  1. Eliminate Delay in Some Pages - We could eliminate the delay on pages where backward navigation is not used. For instance, negating this delay in the Chat Switcher page would address the issue there, but there's a potential for it to recur on other pages.
  2. Find Alternative Solutions - Another tactic would be to discover another fix for the navigation issue, which would allow us to eliminate the timeout altogether. This would, in turn, automatically rectify the problem of missing characters.

Indeed, the second option seems inherently superior, though it could demand an extended period of research and testing to stumble upon an alternative solution for this issue. What are your thoughts?

kevinksullivan commented 5 months ago

followed up in slack

https://expensify.slack.com/archives/C05LX9D6E07/p1717540088086959?thread_ts=1716804890.419359&cid=C05LX9D6E07

It seems like we either need to find someone internal to get on this and make it Daily if we think it's truly CRITICAL, or lower the priority level so it is not CRITICAL.

mallenexpensify commented 5 months ago

PR is in review. Let me know if I can hellp with testing, I have a feeling regressions on this could be pretty bad.

mallenexpensify commented 4 months ago

@aimane-chnaif can you please accept the job and reply here once you have? https://www.upwork.com/jobs/~01bcbf7accb280d408

I reviewed the issue and PR, there are pretty much no comments on this issue but you reviewed the PR and made a couple comments, so I set the price at $250.

aimane-chnaif commented 4 months ago

Accepted thanks. @mallenexpensify what do you think of https://github.com/Expensify/App/issues/43004#issuecomment-2179142446?

mallenexpensify commented 4 months ago

Contributor+: @aimane-chnaif paid $250 via Upwork.

@aimane-chnaif , for urgent issues, they need to have the High Priority label in order to be auto-increased in price. The issue you linked to was an error that I'm addressing internally.