-
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
[HOLD for payment 2023-07-05] [$1000] Chat - App crashes when edit comment clicked for mark down message #20847
Comments
Triggered auto assignment to @dylanexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~0115b4eacb891784a9 |
Current assignee @dylanexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.App crashes when editing message after replying to thread and go back. What is the root cause of that problem?It's here
flatListRef.current is null but we call scrollToIndex on it so it crashes.
The deeper root cause is that we're setting the
1 actually happens after 2 so the What changes do you think we should make in order to solve the problem?
Same for the
so that when What alternative solutions did you explore? (Optional)Another way to do |
@dukenv0307 ere you bale to find the PR which introduced this? |
@fedirjh let us know what you think of the proposasl, thanks |
|
Thanks, what about the proposal of @dukenv0307 then? |
ProposalPlease re-state the problem that we are trying to solve in this issue.Crash when edit a message after coming back from another chat What is the root cause of that problem?It has the same root cause with this issue #20513 I worked on previously (here is the proposal). So, we have a global ref for the message list. App/src/libs/ReportScrollManager/index.js Lines 3 to 5 in bd0e843
and is set in ReportActionsList App/src/pages/home/report/ReportActionsList.js Lines 152 to 155 in bd0e843
When we close a chat, that ref will become null. It's not a regression from #20296 but from the new navigation. This doesn't happen before because report screen is always mounted. What changes do you think we should make in order to solve the problem?I would suggest to use the same solution.
ReportScrollManager is also being used in MoneyRequestModal too which is a separate page from ReportScreen. App/src/pages/iou/MoneyRequestModal.js Lines 398 to 405 in bd0e843
It will scroll to bottom when we do a money request. As we are removing the global ref, we need a way to have the same behavior with the local ref. To achieve this, we can use the same approach of scrolling to bottom when we add a new message. In ReportActionsView, we have a listener that will scroll to bottom when a new action is added from the current user: App/src/pages/home/report/ReportActionsView.js Lines 102 to 111 in bd0e843
When we add a new action, we will trigger the listener here App/src/libs/actions/Report.js Lines 299 to 305 in bd0e843
So, here is what we need to do:
This issue could potentially happens to all global ref. |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
@mountiny This solution will prevent the crash , we can implement it and keep this issue open for more investigation. Other thing that I noticed. LEt's say we have an edit composer open in a chat Report/ thread. If we navigate from LHN to the chat report, It will automatically scroll to the open edit composer , however if we navigate from child thread to the parent report , nothing will happen.
|
@bernhardoj That’s an interesting proposal 👍🏼 |
that would be a separate issue |
@bernhardoj Is it possible that we use hooks + context for your solution ? |
@fedirjh sorry, which part exactly do you wondering whether it's possible to use hooks or not? |
@bernhardoj The function useReportScrollManager(props) {
const flatListRef = useContext(ReportListRefContext);
const scrollToIndex = (index) => {
flatListRef.current.scrollToIndex(index);
};
const scrollToBottom = () => {
if (!flatListRef.current) {
return;
}
flatListRef.current.scrollToOffset({ animated: false, offset: 0 });
};
return [flatListRef, scrollToIndex, scrollToBottom];
} |
I guess that would work, we will create 2 useReportScrollManager, index.js and index.native.js. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.33-4 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 2023-07-05. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
Nice! Will get payments today, @fedirjh will you work on list? |
Regression Test Proposal
Do we agree 👍 or 👎 |
@fedirjh @bernhardoj mind applying here?? |
Applied |
ty @bernhardoj! Will pay out today! |
@bernhardoj offer sent! |
@fedirjh you're paid via ND, right? |
@dylanexpensify Nope , I think that I already applied to the upwork job. |
@dylanexpensify Thank you! Applied. |
Offfer sent! |
payment sent, thanks @fedirjh!! |
done! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when executing PR #20336
Action Performed:
Expected Result:
Verify that thread title still display as the text of the message instead of the markdown of the message
Actual Result:
App crashes
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.28.3
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Notes/Photos/Videos: Any additional supporting documentation
app.crash.20336.MP4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: