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 2023-12-06] [$500] Assign Task - The app crashes when canceling a task in offline mode #31587
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 1.4.1-4 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:
Pre-condition: In LHN task received on previous date with green dot is required
Launch app
Tap on profile---Preferences
Toggle on forced offline
Navigaye to LHN
Tap on task received on previous dates with greet dot
Tap on 3 dots on top right
Tap cancel
Expected Result:
PAs receiver of task login and cancel task in offline, app must not crash
Actual Result:
The app crashes when canceling a task in offline mode
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Assign Task - The app crashes when canceling a task in offline mode[/-][+][$500] Assign Task - The app crashes when canceling a task in offline mode[/+]on Nov 20, 2023
What changes do you think we should make in order to solve the problem?
If sortedReportActions is an empty array we should return an empty object instead of returning null. That can make sure that all places that use getLastVisibleAction will not make the app crash
Proposal from @abzokhattab looks good to me #31587 (comment)
We should just fix correct usage for lastVisibleActionCreated
Based on this PR https://github.com/Expensify/App/pull/28570/files - we already moved away from returning {} (which will break TS paradigm for that function and may lead to more regressions @dukenv0307 based on your suggestion)
Problem also was not discovered before because not everything are in TS. That's why error was not caught.
Also my suggestion will be to add more unit test here tests/unit/ReportActionsUtilsTest.js for getLastVisibleAction function
🎀 👀 🎀 C+ reviewed
changed the title [-][$500] Assign Task - The app crashes when canceling a task in offline mode[/-][+][HOLD for payment 2023-12-06] [$500] Assign Task - The app crashes when canceling a task in offline mode[/+]on Nov 29, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.4-3 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-12-06. 🎊
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.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
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:
[@narefyev91] The PR that introduced the bug has been identified. Link to the PR:
[@narefyev91] 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:
[@narefyev91] 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:
[@narefyev91] Determine if we should create a regression test for this bug.
[@narefyev91] 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.
[@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The PR that introduced the bug has been identified. Link to the PR - was not coming from regression - just missing additional check to prevent crash
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 - N/A
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
[-]Assign Task - The app crashes when canceling a task in offline mode[/-][+][$500] Assign Task - The app crashes when canceling a task in offline mode[/+]melvin-bot commentedon Nov 20, 2023
Triggered auto assignment to @sonialiap (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Nov 20, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01a371f1783ea64c60
melvin-bot commentedon Nov 20, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Nov 20, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @narefyev91 (
External)abzokhattab commentedon Nov 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes on canceling a task in offline mode
What is the root cause of that problem?
The app throws the following err in this line:
App/src/libs/actions/Task.js
Line 761 in f5bfd45
this happens because the
getLastVisibleActionfunction returns null in this line with resulting in the prev err:App/src/libs/ReportActionsUtils.ts
Lines 394 to 396 in 80ea5ca
What changes do you think we should make in order to solve the problem?
use lodash to access the
.createdprop as we are doing heredukenv0307 commentedon Nov 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes when canceling a task in offline mode
What is the root cause of that problem?
When we receive a task and go offline before visiting the task report, this report will have no report action.
So
getLastVisibleActionreturn nullApp/src/libs/ReportActionsUtils.ts
Lines 394 to 396 in 8c909d1
and then the app crashes here
App/src/libs/actions/Task.js
Line 761 in 8c909d1
What changes do you think we should make in order to solve the problem?
If
sortedReportActionsis an empty array we should return an empty object instead of returningnull. That can make sure that all places that usegetLastVisibleActionwill not make the app crashApp/src/libs/ReportActionsUtils.ts
Lines 394 to 396 in 8c909d1
We also need to check all places are calling this function to see if it is used like
action.key1.key2we should uselodashGetfor this.What alternative solutions did you explore? (Optional)
narefyev91 commentedon Nov 21, 2023
Proposal from @abzokhattab looks good to me #31587 (comment)
We should just fix correct usage for lastVisibleActionCreated
Based on this PR https://github.com/Expensify/App/pull/28570/files - we already moved away from returning {} (which will break TS paradigm for that function and may lead to more regressions @dukenv0307 based on your suggestion)
Problem also was not discovered before because not everything are in TS. That's why error was not caught.
Also my suggestion will be to add more unit test here tests/unit/ReportActionsUtilsTest.js for getLastVisibleAction function
🎀 👀 🎀 C+ reviewed
12 remaining items
[-][$500] Assign Task - The app crashes when canceling a task in offline mode[/-][+][HOLD for payment 2023-12-06] [$500] Assign Task - The app crashes when canceling a task in offline mode[/+]melvin-bot commentedon Nov 29, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 29, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.4-3 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-12-06. 🎊
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.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 29, 2023
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:
sonialiap commentedon Dec 7, 2023
@abzokhattab contributor $500 - paid ✔️
sonialiap commentedon Dec 7, 2023
@narefyev91 please complete the checklist :)
narefyev91 commentedon Dec 7, 2023
sonialiap commentedon Dec 8, 2023
Thanks!