You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] Thread - App crashes after rejoining thread and opening thread header #44196
Version Number: 9.0.1-0 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to any chat
Send a message and also send a reply in thread
In thread, click 3-dot menu > Leave
Go to the thread again
Click Join
Immediately click on the chat header after rejoining the thread
Wait for the crash
Expected Result:
App will not crash
Actual Result:
App crashes after rejoining thread and opening thread header
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
@iwiznia 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
Please re-state the problem that we are trying to solve in this issue.
App crashes
What is the root cause of that problem?
This issue occurred because sortedAllReportActions is undefined, and we are checking the condition sortedAllReportActions.length. Since sortedAllReportActions is undefined, there are pending merge operations for the key during the first connection, as shown in the image below:
To fix this issue, we need to validate if sortedAllReportActions is undefined before checking its length. We should use a default value in destructuring to ensure sortedAllReportActions is always defined and avoid extra undefined checks. Get sortedAllReportActionsat.
I was able to reproduce on Staging, and on main only if I enable Staging server.
Yes TS is catching and actually showing that sortedAllReportActions is ReportAction[] because we defined a selector and we are always returning an an array inside it. From TS perspective everything is correct.
Yet sortedAllReportActions is still being undefined in this particular situation that shouldn't be possible, I'm still investigating why it's happening (now it will be easier because I was able to reproduce on main)
changed the title [-]Thread - App crashes after rejoining thread and opening thread header[/-][+][HOLD for payment 2024-07-02] Thread - App crashes after rejoining thread and opening thread header[/+]on Jun 25, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.1-19 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@situchan] The PR that introduced the bug has been identified. Link to the PR:
[@situchan] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@situchan] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@situchan] Determine if we should create a regression test for this bug.
[@situchan] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
changed the title [-][HOLD for payment 2024-07-02] Thread - App crashes after rejoining thread and opening thread header[/-][+][HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] Thread - App crashes after rejoining thread and opening thread header[/+]on Jul 3, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@situchan] The PR that introduced the bug has been identified. Link to the PR:
[@situchan] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@situchan] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@situchan] Determine if we should create a regression test for this bug.
[@situchan] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
melvin-bot commentedon Jun 22, 2024
Triggered auto assignment to @iwiznia (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Jun 22, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
lanitochka17 commentedon Jun 22, 2024
@iwiznia 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
lanitochka17 commentedon Jun 22, 2024
We think that this bug might be related to #vip-vsp
huult commentedon Jun 22, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes
What is the root cause of that problem?
This issue occurred because
sortedAllReportActionsisundefined, and we are checking the conditionsortedAllReportActions.length. SincesortedAllReportActionsisundefined, there are pending merge operations for the key during the first connection, as shown in the image below:To fix this issue, we need to validate if
sortedAllReportActionsisundefinedbefore checking its length. We should use a default value in destructuring to ensuresortedAllReportActionsis always defined and avoid extraundefinedchecks. GetsortedAllReportActionsat.Note:
This PR handled the case where useOnyx returns undefined.
POC
Screen.Recording.2024-06-22.at.23.40.27.mov
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
mountiny commentedon Jun 24, 2024
Asked @fabioh8010 to look into this as he has been working on the useOnyx changes
iwiznia commentedon Jun 24, 2024
@fabioh8010 any update here?
Also, why didn't ts catch this earlier? Isn't this type of error exactly the ones TS should be catching before they are merged?
mountiny commentedon Jun 24, 2024
Here is the thread btw
fabioh8010 commentedon Jun 24, 2024
@iwiznia @mountiny My investigations so far:
mainonly if I enable Staging server.sortedAllReportActionsisReportAction[]because we defined aselectorand we are always returning an an array inside it. From TS perspective everything is correct.sortedAllReportActionsis still beingundefinedin this particular situation that shouldn't be possible, I'm still investigating why it's happening (now it will be easier because I was able to reproduce onmain)19 remaining items
[-]Thread - App crashes after rejoining thread and opening thread header[/-][+][HOLD for payment 2024-07-02] Thread - App crashes after rejoining thread and opening thread header[/+]melvin-bot commentedon Jun 25, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 25, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.1-19 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-07-02. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 25, 2024
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:
bfitzexpensify commentedon Jul 2, 2024
Payment summary:
@situchan due $250 for PR review to be paid via manual request
situchan commentedon Jul 2, 2024
@bfitzexpensify I am still using upwork
[-][HOLD for payment 2024-07-02] Thread - App crashes after rejoining thread and opening thread header[/-][+][HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] Thread - App crashes after rejoining thread and opening thread header[/+]melvin-bot commentedon Jul 3, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 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-07-10. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 3, 2024
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:
situchan commentedon Jul 11, 2024
kind bump ^
bfitzexpensify commentedon Jul 12, 2024
Apologies @situchan!
Offer sent via Upwork.