App icon indicating copy to clipboard operation
App copied to clipboard

New Marker does not get updated properly while switching between same chat and chat list.

Open Santhosh-Sellavel opened this issue 5 years ago • 43 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


There are two issues but are similar and the same fix would solve both. So grouped as one.

Action Performed:

Issue 1

  1. Open any user chat.
  2. Tap the back arrow to navigate to the chat list.
  3. Now wait for a new message from the user.
  4. After receiving the message open the chat, the new marker is not shown.

Issue 2

  1. Open any other chat.
  2. Tap the back arrow to navigate to the chat list.
  3. Now wait for a new message from the user.
  4. After receiving the message open the chat, the new marker will be shown now.
  5. But go to the chat list, open chat again. The new marker will not hide.

Expected Result:

Issue 1

The new marker should be shown.

Issue 2

The new marker should be hidden while open the chat for the second time.

Actual Result:

Issue 1

The new marker is not shown.

https://user-images.githubusercontent.com/85645967/127779739-c2383d3a-a757-4264-9b4f-15fd2992ba08.mov

Issue 2

The new marker will not hide even closing and opening multiple times.

https://user-images.githubusercontent.com/85645967/127780089-5ed51986-af0e-4f57-9848-6153988f3ed0.mov

Workaround:

Can the user still use Expensify without this being fixed? Yes

Issue 1

Need wait from another user, then a new marker will be shown.

Issue 2

New marker only if we switch to other chat and navigate back here.

Platform:

Where is this issue occurring?

  • [x] iOS
  • [x] Android
  • [x] Mobile Web

Proposal

Move the following lines to a new method let's call it maintainNewMarkerPlace (suggest new name if needed) https://github.com/Expensify/App/blob/87cbc24238115426df8c16111d790f77930b9bfb/src/pages/home/report/ReportActionsView.js#L124-L131 then bind the method.

And invoke in the componentDidMount method (since we moved those lines from which is intended to happen). Screenshot 2021-08-01 at 11 19 16 PM

And in shouldComponentUpdate method as below, Screenshot 2021-08-01 at 11 14 59 PM

Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:

View all open jobs on Upwork

Santhosh-Sellavel avatar Aug 01 '21 17:08 Santhosh-Sellavel

Triggered auto assignment to @jboniface (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Aug 01 '21 17:08 MelvinBot

Fix Demo:

https://user-images.githubusercontent.com/85645967/127781026-24b485c9-77ac-45bc-bb0b-cb8dbc4f30ab.mp4

Santhosh-Sellavel avatar Aug 01 '21 18:08 Santhosh-Sellavel

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

MelvinBot avatar Aug 03 '21 21:08 MelvinBot

Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Aug 05 '21 14:08 MelvinBot

I'm putting the external label on this so we can get an upwork listing created. I think the problem makes sense and the proposal fits (but I'll have the engineer assigned double check it).

TomatoToaster avatar Aug 05 '21 14:08 TomatoToaster

One thing I will say is that I don't think this method should also be in shouldComponentUpdate. That function should only handle the boolean logic on whether the props changing is relevant to rerun componentDidUpdate. Instead you should move that call of this.maintainNewMarkerPlace() to componentDidUpdate. I think it makes more sense for it to be there since you're already telling it to run componentDidUpdate with the return true in the second snippet you have.

Does that suggestion make sense?

TomatoToaster avatar Aug 05 '21 15:08 TomatoToaster

I will move that to componentDidUpdate it makes more sense for me too. @TomatoToaster

Santhosh-Sellavel avatar Aug 05 '21 16:08 Santhosh-Sellavel

@Santhosh-Sellavel and @TomatoToaster - I'm just catching up as I've been OOO.

Given that https://github.com/Expensify/App/issues/4472 has been created, can I close this issue? I assume they're the same issue - correct?

jliexpensify avatar Aug 08 '21 23:08 jliexpensify

@Santhosh-Sellavel and @TomatoToaster - I'm just catching up as I've been OOO.

Given that https://github.com/Expensify/App/issues/4472 has been created, can I close this issue? I assume they're the same issue - correct?

@jliexpensify IMO, they are not same issue.

Santhosh-Sellavel avatar Aug 09 '21 06:08 Santhosh-Sellavel

Sorry for the delay, was checking a few things with @TomatoToaster - posted to Upworks: https://www.upwork.com/ab/applicants/1424866489594466304/job-details

@Santhosh-Sellavel - thanks for your patience. Please feel free to apply in Upworks!

jliexpensify avatar Aug 09 '21 22:08 jliexpensify

Triggered auto assignment to @timszot (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Aug 09 '21 22:08 MelvinBot

Hi @timszot - do you mind checking out Santhosh's proposal here, so we can get him hired? Thanks!

jliexpensify avatar Aug 10 '21 22:08 jliexpensify

@jliexpensify I feel something is fishy going. The changes I proposed do not work for me now. Considering #4472 depend's on this issue solution and related. I would revisit the changes and update a new proposal soon, max within 3 - 4 days. If not I'll let you lets make it open for others also thanks!

Santhosh-Sellavel avatar Aug 11 '21 15:08 Santhosh-Sellavel

Thanks for the update @Santhosh-Sellavel - have added a [Hold] to the title and updated the GH to weekly to give you a little more time. Feel free to tag Tim when you've got a solution, or let us know if this GH can be closed!

jliexpensify avatar Aug 11 '21 23:08 jliexpensify

Any update here @Santhosh-Sellavel ? Asking since this went Overdue.

timszot avatar Aug 20 '21 20:08 timszot

@timszot Sorry for the delayed notice. Working on it along with a couple of new items discussed here Will update the status by Monday again on progress thanks!

Santhosh-Sellavel avatar Aug 20 '21 20:08 Santhosh-Sellavel

Proposal

@timszot Move the following lines to a new method let's call it updateUnreadIndicatorPosition (suggest new name if needed) https://github.com/Expensify/App/blob/bdcafa3444f3839d7f5de2300e258caf681a50e3/src/pages/home/report/ReportActionsView.js#L130-L137

updateUnreadIndicatorPosition it's slightly modified to address other issues discussed here

Screenshot 2021-08-23 at 12 45 28 AM

And invoke in the componentDidMount method (since we moved those lines from which is intended to happen). Screenshot 2021-08-23 at 12 44 23 AM

We should modify the following lines https://github.com/Expensify/App/blob/bdcafa3444f3839d7f5de2300e258caf681a50e3/src/pages/home/report/ReportActionsView.js#L204-L213

As shown below, these should occur only when there are no new messages because other cases are handled above in the above if statement. Screenshot 2021-08-23 at 12 36 55 AM

These changes will solve the issues discussed here. Will raise a single PR along with addressing all other issues!

Santhosh-Sellavel avatar Aug 22 '21 19:08 Santhosh-Sellavel

@Santhosh-Sellavel A PR shouldn't be opened until you've proposed a solution and have been hiring in Upwork per our contributing guidelines. On that note... @jliexpensify let's hire @Santhosh-Sellavel for this one!

timszot avatar Aug 23 '21 15:08 timszot

@timszot I'm quite aware of that rule, thanks!

Santhosh-Sellavel avatar Aug 23 '21 15:08 Santhosh-Sellavel

Hired @Santhosh-Sellavel , then Upworks crashed:

image

Let me know if you didn't receive an offer, and I'll look into it further!

jliexpensify avatar Aug 23 '21 23:08 jliexpensify