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
[$500] Login - App crashes when going through task creation flow while the app is still loading #30539
Version Number: 1.3.92-2
**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:
Go to staging.new.expensify.com
Log in with a high traffic account
While the app is still loading, click + on the composer > Assign task
Enter a title and hit ENTER to proceed to the next page
Expected Result:
App does not crash
Actual Result:
App crashes
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Login - App crashes when going through task creation flow while the app is still loading[/-][+][$500] Login - App crashes when going through task creation flow while the app is still loading[/+]on Oct 27, 2023
The RCA is that when the reportID that we get from route is '0', then clicking on "Assign task" it will call clearOutTaskInfoAndNavigate(reportID) with reportID is '0':
So just need to use isReportReadyForDisplay to check should we prevent user from clicking on "Assign task" or not
What alternative solutions did you explore? (Optional)
Also we can add the method that will auto-set the share destination once the reportID is loaded correctly. We can do that by using withCurrentReportID:
Please re-state the problem that we are trying to solve in this issue.
Login - App crashes when going through task creation flow while the app is still loading
What is the root cause of that problem?
When login with account high traffic account or slow network report data still loading but create task use a report data so when click next button will crash at this line due to participantAccountIDs is empty
It can reproduce if we change network status on login
30539.mp4
What changes do you think we should make in order to solve the problem?
We should subscribe ONYXKEYS.IS_LOADING_APP for NewTaskPage at withOnyx
Please re-state the problem that we are trying to solve in this issue.
Login - App crashes when going through task creation flow while the app is still loading
What is the root cause of that problem?
When logging in with a high-traffic account or on a slow network, the report data is still loading. However, when opening the NewTaskPage before the report data has loaded, the participantAccountIDs variable is undefined, resulting in a crash.
What changes do you think we should make in order to solve the problem?
I should use a Shimmer as an input container placeholder to prevent users from assigning a task before the report data loads.
What alternative solutions did you explore? (Optional)
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
The PR that introduced the bug has been identified. Link to the PR: N/A - behaviour was always there as far as I can tell
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: N/A
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: N/A
Determine if we should create a regression test for this bug. Yes
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.
Regression Test Proposal
Open the app, ideally on a slow network
Before the report chat finishes loading, click + on the composer > Assign task
Activity
[-]Login - App crashes when going through task creation flow while the app is still loading[/-][+][$500] Login - App crashes when going through task creation flow while the app is still loading[/+]melvin-bot commentedon Oct 27, 2023
Triggered auto assignment to @abekkala (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 27, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01949234f35124ab07
melvin-bot commentedon Oct 27, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 27, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)mkhutornyi commentedon Oct 27, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes on assign task confirmation page when opened quickly after login
What is the root cause of that problem?
App/src/libs/actions/Task.js
Lines 672 to 676 in 533a373
When open NewTaskPage before loading reports data,
participantAccountIDsis undefined so in line 676, it calls undefined.length which leads to crash.What changes do you think we should make in order to solve the problem?
Add fallback to lodashGet -
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);DylanDylann commentedon Oct 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
reportis undefined, so accessinglengthofparticipantAccountIDleads to the error.App/src/libs/actions/Task.js
Line 676 in a59d56f
reportIDthat we get fromrouteis '0', then clicking on "Assign task" it will callclearOutTaskInfoAndNavigate(reportID)withreportIDis '0':App/src/libs/actions/Task.js
Lines 636 to 640 in a59d56f
Task.getShareDestinationis called withreportIDis '0':App/src/pages/tasks/NewTaskPage.js
Line 98 in a59d56f
reportreturned fromApp/src/libs/actions/Task.js
Line 673 in a59d56f
participantAccountIDsfrom undefined will leads to the bug.What changes do you think we should make in order to solve the problem?
Solution 1: If the
reportIDis still '0', we can consider the "Assign task" action in the report is the same the "Assign task" in the FAB by updating:App/src/libs/actions/Task.js
Lines 636 to 640 in a59d56f
to
Solution 2:
ReportFooterin caseisReportReadyForDisplayis false:App/src/pages/home/ReportScreen.js
Line 468 in a59d56f
isReportReadyForDisplayto check should we prevent user from clicking on "Assign task" or notWhat alternative solutions did you explore? (Optional)
reportIDis loaded correctly. We can do that by usingwithCurrentReportID:App/src/pages/tasks/NewTaskPage.js
Lines 90 to 92 in a59d56f
to
suneox commentedon Oct 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Login - App crashes when going through task creation flow while the app is still loading
What is the root cause of that problem?
When login with account high traffic account or slow network report data still loading but create task use a report data so when click
next buttonwill crash at this line due toparticipantAccountIDsis emptyIt can reproduce if we change network status on login
30539.mp4
What changes do you think we should make in order to solve the problem?
We should subscribe
ONYXKEYS.IS_LOADING_APPforNewTaskPageat withOnyxthen and render a loading state at this line
And set a default value for this line
after fix
30539_after_fix_2.mp4
What alternative solutions did you explore? (Optional)
We can hide the ReportFooter if
isLoaddingAppdue to we don't have the context to create a task and avoid other issuesSubscribe app loading at
and check before render
maxconnectAbhi commentedon Oct 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Login - App crashes when going through task creation flow while the app is still loading
What is the root cause of that problem?
When logging in with a high-traffic account or on a slow network, the report data is still loading. However, when opening the NewTaskPage before the report data has loaded, the
participantAccountIDsvariable is undefined, resulting in a crash.What changes do you think we should make in order to solve the problem?
I should use a Shimmer as an input container placeholder to prevent users from assigning a task before the report data loads.
What alternative solutions did you explore? (Optional)
N/A
17 remaining items
melvin-bot commentedon Oct 30, 2023
📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
melvin-bot commentedon Oct 30, 2023
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
DylanDylann commentedon Nov 1, 2023
@jjcoffee PR #30670 is ready for review
abekkala commentedon Nov 13, 2023
Deployed to Prod - 3 days ago 🎉
jjcoffee commentedon Nov 20, 2023
@abekkala I think this one's due for payment?
jjcoffee commentedon Nov 21, 2023
Regression Test Proposal
Do we agree 👍 or 👎
jjcoffee commentedon Nov 21, 2023
@abekkala Completed the checklist manually since automation went a bit wonky here! This has been in production since Nov 10, so is overdue payment.
abekkala commentedon Nov 22, 2023
Reviewer: Applause
Fix: @DylanDylann [$500]
PR Review: @jjcoffee [$500]
abekkala commentedon Nov 22, 2023
@DylanDylann and @jjcoffee payments made and contracts ended - thank you! 🎉