-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2024-04-09] [$500] LOW - Android-Thread-Incorrect number of replies displayed for multilevel thread when going back #38002
Comments
Triggered auto assignment to @bfitzexpensify ( |
We think that this bug might be related to #vip-vsp |
@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
ProposalPlease re-state the problem that we are trying to solve in this issue.The thread replies number doesn't count the nested thread, except when we reopen the chat. What is the root cause of that problem?Currently, when we add a new comment to the thread, we only update the thread direct parent number of replies optimistically. App/src/libs/actions/Report.ts Lines 526 to 530 in 9302ade
Lines 2912 to 2930 in 9302ade
Lines 2869 to 2902 in 9302ade
After we reopen the app, the BE will give us the correct number of replies. What changes do you think we should make in order to solve the problem?Update all the report parent and ancestors number of replies. To do that, we can either modify We will get the list of the ancestors from // getOptimisticDataForParentReportAction
...
const ancestors = getAllAncestorReportActionIDs(report);
const totalAncestor = ancestors.reportIDs.length;
return Array.from(Array(totalAncestor), (_, index) => {
const ancestorReport = getReport(ancestors.reportIDs[index]);
const ancestorReportAction = ReportActionsUtils.getReportAction(ancestorReport.reportID, ancestors.reportActionsIDs[index]);
return {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${ancestorReport.reportID}`,
value: {
[ancestorReportAction?.reportActionID ?? '']: updateOptimisticParentReportAction(ancestorReportAction, lastVisibleActionCreated, type),
},
};
}) And because it now returns an array of onyx update, we need to modify the add comment code to push the data one by one. const optimisticParentReportData = ReportUtils.getOptimisticDataForParentReportAction(...)
optimisticParentReportData.forEach((parentReportData) => {
if (!isEmptyObject(parentReportData)) {
optimisticData.push(parentReportData);
}
}) |
@bfitzexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Job added to Upwork: https://www.upwork.com/jobs/~017a1e94fc9637db19 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
Added to the VSB project with a LOW priority |
Awaiting a volunteer |
Same update |
@bernhardoj Your proposal makes sense to me. Did you test the solution on native? I'm particularly concerned about its potential impact on the performance of adding comments, especially as the thread depth increases. |
Before: Screen.Recording.2024-03-16.at.16.03.00.movAfter: Screen.Recording.2024-03-16.at.16.00.32.mov@fedirjh I feel like there is no performance degradation noticeable after applying the solution. If I'm correct, the onyx will merge it asynchronously. Also, we use FreezeWrapper so only the current and previous screen will re-render when the onyx is updated. App/src/libs/Navigation/FreezeWrapper.tsx Lines 26 to 30 in 2979e3c
|
@fedirjh, @bfitzexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Thanks for confirming @bernhardoj; The result seems satisfactory. We can proceed with further testing in the PR. Let's proceed with @bernhardoj proposal. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Issue not reproducible during KI retests. (First week) |
It's still reproducible. PR is ready cc: @fedirjh |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-04-09. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Payment summary: Contributor: $500 to @bernhardoj - completed via Upwork ✅ |
@puneetlath, @fedirjh, @bfitzexpensify, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick! |
BugZero Checklist:
|
Thanks @fedirjh - agree with your assessment. Payment complete, we're all done here - thanks everyone! |
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.49-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4411711
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The correct number of replies is displayed for every thread
Actual Result:
The number of replies does not change when navigating back to the parent thread. The count of replies updates after opening the multilevel thread
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6407285_1709922506831.video_2024-03-08_13-27-41.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @fedirjhThe text was updated successfully, but these errors were encountered: