-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] mWeb - Chat - Tapping on new messages after marking a message unread leads to a blank page #31591
Comments
Triggered auto assignment to @JmillsExpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~017b6f62003e67ff2c |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.mWeb - Chat - Tapping on new messages after marking a message unread leads to a blank page What is the root cause of that problem?There are two problems: 1- Showing a blank screen when clicking on the New Message button The problem is related to the Here's the code in the App/src/components/InvertedFlatList/index.js Lines 82 to 102 in 72e73ae
In the If you scroll and wait for this action to finish and click on the "New messages" button, this behavior won't occur. 2- When clicking on the "New Message" button the scroll goes to the view bottom The App/src/pages/home/report/ReportActionsList.js Lines 303 to 307 in 8c909d1
What changes do you think we should make in order to solve the problem?1- Showing a blank screen when clicking on the New Message button We should call the 1. Change the method For example: /**
* Emits when the scrolling has ended.
*
* @param {Event} event - The onScroll event from the FlatList
*/
const onScrollEnd = (event) => {
props.onScroll(event);
eventHandler.current = DeviceEventEmitter.emit(CONST.EVENTS.SCROLLING, false);
updateInProgress.current = false;
}; 2. Change the method For example: /**
* Emits when the scrolling is in progress. Also,
* invokes the onScroll callback function from props.
*/
const onScroll = () => {
if (updateInProgress.current) {
return;
}
updateInProgress.current = true;
eventHandler.current = DeviceEventEmitter.emit(CONST.EVENTS.SCROLLING, true);
}; 3. Change the method For example: const handleScroll = (event) => {
onScroll(); // <- Here we can remove the event from the parameter
const timestamp = Date.now();
if (scrollEndTimeout.current) {
clearTimeout(scrollEndTimeout.current);
}
if (lastScrollEvent.current) {
scrollEndTimeout.current = setTimeout(() => {
if (lastScrollEvent.current !== timestamp) {
return;
}
// Scroll has ended
lastScrollEvent.current = null;
onScrollEnd(event); // <- Here we need to change
}, 250);
}
lastScrollEvent.current = timestamp;
}; 2- When clicking on the New Message button the scroll goes to the view bottom We should improve the method For example, const getScrollIndex = () => {
const bottomIndex = 0;
const firstUnreadMessageIndex = _.findIndex(sortedReportActions, shouldDisplayNewMarker);
return firstUnreadMessageIndex > -1 ? firstUnreadMessageIndex : bottomIndex;
};
const scrollToBottomAndMarkReportAsRead = () => {
const scrollIndex = getScrollIndex();
reportScrollManager.scrollToIndex(scrollIndex, false);
readActionSkipped.current = false;
Report.readNewestAction(report.reportID);
}; Note: maybe we should rename the method name from What alternative solutions did you explore? (Optional)1- Showing a blank screen when clicking on the "New Message" button Besides my proposal above, we can also solve this issue with one of these approaches: Approach 1: Creating a mechanism to delay the We should change the We can use almost the same approach that the App/src/components/Hoverable/index.tsx Lines 83 to 96 in 72e73ae
Approach 2: Adding a delay to call the Changing POC poc-issue-31591.mp4 |
@wlegolas Please explain how the posted root cause caused this issue. |
Sorry, I focused only on the solution to scroll to the first unread message. I updated my proposal with this root cause and the changes that we need to make to fix it. If you have any questions, please feel free to contact me |
Proposal |
@JmillsExpensify, @parasharrajat Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Still working through proposals |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@JmillsExpensify, @parasharrajat Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Going to review it soon. |
Waiting on proposal review |
Good explanation @wlegolas. Let's use your primary solution. Suggestion:
🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@wlegolas @JmillsExpensify @MariaHCD @parasharrajat this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
Hi Melvin, I've just started to change the code. In the next days, I will send the PR with the changes. |
Hi, @parasharrajat regarding your suggestion above, the Using the Could you please, give a direction on how to use the |
I see. You need the index... In that case, I would just replace the predicate in findIndex function of your sample to find the item whose id matches with currentUnreadMarker. It should still be a little faster. |
Hi, @parasharrajat I finished my changes but before I send the PR, I need to check the "New messages" button behaviors.
App/src/pages/home/report/ReportActionsList.js Lines 282 to 294 in 2f80993
The video below shows all these behaviors. Just to confirm, are these the expected behaviors? behavior-new-message-button.mp4 |
This should change now when you are changing the click behaviour. |
I am unsure of whether the scroll to unread logic will work as expected. We should test it with the pagination of chat messages. Test Scenario:
|
In this case, should I hide the button when scrolling to the unread message or is there another behavior that you thought? |
I'll do this test, thank you for helping me. |
Behaviour should be same to what happens currently when we scroll to bottom. Only change we are doing is instead of scrolling to the bottom, we scroll to first unread chat. |
Hi, @parasharrajat I created the PR with the changes to fix the issue. I need to add the evidence for Android Native, I've been having some problems running the simulator. If you have any suggestions or questions, feel free to add a comment in the PR. PR: #32630 |
Hi, @parasharrajat I finished the implementation, just to let you know how the implementation went, I changed the App/src/pages/home/report/ReportActionsList.js Lines 282 to 294 in 632c5c6
I updated my PR with these changes. You can see this behavior in the following evidence: iOS: Nativenew-behavior-IOS-Native.mp4MacOS: Chromenew-behavior-Mac-chrome.mp4 |
Still discussing |
Hi @parasharrajat I don't know if you saw my last commit, but I think I finished the fix and the implementations. If you have any questions or suggestions, please let me know. |
Hi @JmillsExpensify and @MariaHCD, I finished the PR and I don't know if @parasharrajat reviewed it, the last message was two weeks ago. Do you know how we can check with @parasharrajat if this PR is good to merge or not? |
I was busy the last few days. I plan to wrap up soon. |
No problem @parasharrajat, I just asked to know if we should do anything else to close this PR. If you have any questions or suggestions, please let me know. |
This issue has not been updated in over 15 days. @wlegolas, @JmillsExpensify, @MariaHCD, @parasharrajat eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Hi Melvin, we're having a discussion on the PR. I think we are going to have the final changes soon after some tests from @parasharrajat |
BacK from vacation. Will be checking it. |
@wlegolas, @JmillsExpensify, @MariaHCD, @parasharrajat, this Monthly task hasn't been acted upon in 6 weeks; closing. If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead. |
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.1.5
Reproducible in staging?: y
Reproducible in production?: y
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
User should be redirected to the unread message.
Actual Result:
Tapping on new messages after marking a message unread leads to a blank page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6284625_1700519015921.Group_disappears.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: