New Marker does not get updated properly while switching between same chat and chat list.
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
- Open any user chat.
- Tap the back arrow to navigate to the chat list.
- Now wait for a new message from the user.
- After receiving the message open the chat, the new marker is not shown.
Issue 2
- Open any other chat.
- Tap the back arrow to navigate to the chat list.
- Now wait for a new message from the user.
- After receiving the message open the chat, the new marker will be shown now.
- 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).

And in shouldComponentUpdate method as below,

Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:
Triggered auto assignment to @jboniface (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Fix Demo:
https://user-images.githubusercontent.com/85645967/127781026-24b485c9-77ac-45bc-bb0b-cb8dbc4f30ab.mp4
Triggered auto assignment to @TomatoToaster (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
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).
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?
I will move that to componentDidUpdate it makes more sense for me too.
@TomatoToaster
@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?
@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.
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!
Triggered auto assignment to @timszot (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Hi @timszot - do you mind checking out Santhosh's proposal here, so we can get him hired? Thanks!
@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!
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!
Any update here @Santhosh-Sellavel ? Asking since this went Overdue.
@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!
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
And invoke in the componentDidMount method (since we moved those lines from which is intended to happen).

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.

These changes will solve the issues discussed here. Will raise a single PR along with addressing all other issues!
@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 I'm quite aware of that rule, thanks!
Hired @Santhosh-Sellavel , then Upworks crashed:

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