Skip to content

Chat switcher - Old chat is still displayed when selecting new chat in chat switcher #3822

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

Closed
isagoico opened this issue Jun 30, 2021 · 22 comments
Assignees
Labels
Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@isagoico
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!


Action Performed:

  1. Log in to e.cash in Desktop
  2. User A is most recent chat at top
  3. e.cash is backgrounded.
  4. e.cash is brought to foreground with User A at top
  5. Use CMD + K and search for a new user
  6. Search doesn't return new user but still shows User A.

Expected Result:

Open the correct chat

Actual Result:

Previous chat is displayed.

Workaround:

Unknown

Platform:

Where is this issue occurring?

Web
iOS
Android
Desktop App ✔️
Mobile Web

Version Number: 1.0.73-0

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos:
Logs:

DevTools failed to load SourceMap: Could not parse content for app://-/pdf.worker.entry-b22bab8….bundle.worker.js.map: Unexpected end of JSON input
DevTools failed to load SourceMap: Could not parse content for app://-/app-74d3ea1….bundle.js.map: Unexpected end of JSON input

Expensify/Expensify Issue URL:

View all open jobs on Upwork


From @mallenexpensify https://expensify.slack.com/archives/C01GTK53T8Q/p1624980659215800

Search on e.cash on desktop isn't navigating to the chat I selected, it's staying on an old chat. Details in :thred:
e.cash desktop is in the background
command+space, type exp to bring to foreground
command+k, type deet for Scott Deeter, Scott is highlighted at top
Click Enter
Version
Version 1.0.73-3 (1.0.73-3)
Notes
It's early in the morning and my comp has been asleep all night, random guess but it could be related to that? (edited)
It might be happening when...
User A is most recent chat at top
e.cash is backgrounded.
e.cash is brought to foreground with User A at top
Another user is searched for
Search doesn't return new user but still shows User A.
You might have to try a couple times

@MelvinBot
Copy link

Triggered auto assignment to @francoisl (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@francoisl
Copy link
Contributor

Not sure I understand the reproduction steps

User A is most recent chat at top

Top of the chats list in the left menu, or in the quick switcher? And, top as in the first entry in the list if there are multiple? Or top as in it's the active chat?
Anyway I can't see any chat switching issues on v1.0.75-4 (staging version), both desktop and web, can you try again on that version please?

@mallenexpensify
Copy link
Contributor

@francoisl I uploaded a vid here but it has personal chat details so it's only viewable to internal Expensify folks. https://drive.google.com/file/d/1ngIBwYXSEgtFHg8Lg53Ot9OGhrD9qVrQ/view?usp=sharing. It's not related to the chat switcher for the main message pane

User A is most recent chat at top
It's in the main message pane with a user. Using the below screenshot as an example, most recent chat would be the most recent chat sent but it would show at the two older ones that are below it.

image

@francoisl
Copy link
Contributor

Thanks Matt for the video, that makes it clearer. I can't reproduce on v1.0.75-5 (staging version atm). Let's see if you guys can still reproduce when it's promoted to the production version, but it seems like it's already resolved.

@mallenexpensify
Copy link
Contributor

This is happening again but to repro steps are different, I'm confident it's the same issue though. I'm going to assign to myself and make it a weekly to see if I can outline the repro stuff AND get others to actually reproduce

@mallenexpensify mallenexpensify added Planning Changes still in the thought process Weekly KSv2 and removed Engineering Daily KSv2 labels Jul 12, 2021
@mallenexpensify mallenexpensify changed the title Chat switcher - Old chat is still displayed when selecting new chat in chat switcher [HOLD for repro steps] Chat switcher - Old chat is still displayed when selecting new chat in chat switcher Jul 12, 2021
@mallenexpensify
Copy link
Contributor

Still happening on version 1.0.80-2, production, which I just updated to. Here's a vid

updated.short.vid.mp4

Steps

  • In chat with User A
  • typed command + k to access search
  • typed man then 'enter'
  • nothing happened, stayed on same chat as User A (was hoping to go to my 'manager' test account)

@mallenexpensify mallenexpensify changed the title [HOLD for repro steps] Chat switcher - Old chat is still displayed when selecting new chat in chat switcher Chat switcher - Old chat is still displayed when selecting new chat in chat switcher Jul 28, 2021
@mallenexpensify mallenexpensify added Engineering and removed Planning Changes still in the thought process labels Jul 28, 2021
@MelvinBot
Copy link

Triggered auto assignment to @deetergp (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@mallenexpensify mallenexpensify added Daily KSv2 and removed Weekly KSv2 labels Jul 28, 2021
@mallenexpensify
Copy link
Contributor

@deetergp I imagine this is external. Thing there is enough detail for someone to work on? Repro steps are above and theres a vid now

@parasharrajat
Copy link
Member

@mallenexpensify In the vid you posted, the Search was not completed before you press enter.

@mallenexpensify
Copy link
Contributor

But it should have returned something based on the keystrokes I entered vs nothing. ie. in Slack, it never happens that I type a few letters then enter and 'nothing happens'. I'm guessing it's happened 100+ times to me the past month (not exaggerating) . And it espec sucks when you send the wrong chat to someone cuz the chat wasn't switched

@rushatgabhane
Copy link
Member

rushatgabhane commented Jul 29, 2021

Reproducible on web.
Basically you need to type really fast, and before any search result is displayed press Enter.

I don't know how to fix this yet, will update later today.

Screencast.from.29-07-21.05_31_24.AM.+03.mp4

@rushatgabhane
Copy link
Member

rushatgabhane commented Jul 29, 2021

@mallenexpensify Pretty sure it's because of a 'high' debounce timeout of 300 ms.

Changing it to a lower value like 50 ms, fixes the issue.
We'll need to discuss this further to get a perfect timeout value as low values have their cons.

We could also delay Enter key press by the timeout value. This way, the chat is only selected after search is complete.

this.debouncedUpdateOptions = _.debounce(this.updateOptions.bind(this), 300);

Screencast.from.29-07-21.06_01_57.AM.+03.mp4

@mallenexpensify
Copy link
Contributor

@rushatgabhane thanks for the 👀, I just came here to add something like what you said Basically you need to type really fast, and before any search result is displayed press Enter..

Changing it to a lower value like 50 ms, fixes the issue.
Are there downsides to this approach?

In general, I def don't think we should penalize people for typing fast (mostly unrelated, I try to navigate NewDot from my keyboard as much as possible and LOVE keyboard shortcuts)

@deetergp
Copy link
Contributor

Definitely external

@deetergp deetergp added the External Added to denote the issue can be worked on by a contributor label Jul 29, 2021
@deetergp
Copy link
Contributor

@rushatgabhane Can you confirm your fix works on the Desktop App, since that's where it was reported?

@rushatgabhane
Copy link
Member

rushatgabhane commented Jul 29, 2021

75ms is the highest time that does the trick for me.

Are there downsides to this approach?

@mallenexpensify yes.

Firstly, it'll lead to more re-renders when searching. (Hard to quantify as it depends on typing speed)
As mentioned in details of this PR .

added some debounce in since we are filtering the options rather often and triggering re-renders. When we can wait until the user is done typing to do this.

Moreover, this issue will still happen if you press Enter within 75ms of typing the last character. (Humans aren't that fast, so no need to worry here)

In conclusion, since it's all frontend and no API calls are made when filtering, I don't think reducing the debounce time to 75ms is such a bad idea.

@rushatgabhane
Copy link
Member

rushatgabhane commented Jul 29, 2021

@rushatgabhane Can you confirm your fix works on the Desktop App, since that's where it was reported?

@deetergp
Yes, it works on desktop app. Just tested.

@deetergp
Copy link
Contributor

@rushatgabhane Proposal sounds good to me. Let's do it!

@mallenexpensify
Copy link
Contributor

https://www.upwork.com/jobs/~01fa161c1944380e84
Let me know when you've submitted a proposal in Upwork @rushatgabhane and I'll hire you

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 29, 2021
@rushatgabhane
Copy link
Member

rushatgabhane commented Jul 29, 2021

Let me know when you've submitted a proposal in Upwork @rushatgabhane and I'll hire you

@mallenexpensify Done ✅

@mallenexpensify mallenexpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 29, 2021
@deetergp deetergp added the Reviewing Has a PR in review label Jul 30, 2021
@MelvinBot
Copy link

@deetergp, @mallenexpensify, @rushatgabhane Whoops! This issue is 2 days overdue. Let's get this updated quick!

@mallenexpensify
Copy link
Contributor

Looks like this was deployed to staging 7 days ago and there have been no regressions. Also just tested quickly on production, desktop and it appears to be working. Paid @rushatgabhane in Upwork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants