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
[Due for payment 2025-09-09] Task - App crashes when opening task share destination list #69244
Version Number: 9.1.99-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exp #67772 Email or phone of affected tester (no customers):sdondsijsodios@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Other
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create a task in the workspace chat.
Delete the workspace.
Click FAB.
Click Assign task under Quick action.
Enter title > Next.
Click Share field.
Expected Result:
App will not crash.
Actual Result:
App crashes when opening task share destination list.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
When the workspace is deleted, the reports array changes, causing different numbers of useReportIsArchived hooks to be called on different renders, which breaks React hook consistency requirement
What changes do you think we should make in order to solve the problem?
We can follow the pattern used in here to pre-compute archived reports at the component top level
This violates React's rule of hooks and cause app crash.
What changes do you think we should make in order to solve the problem?
This change was added in #68269 to remove usage of reportNameValuePairs. Following that rule, we should update to change reportFilter into a hook instead.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We should add a new lint rule to detect violated usage of hooks. We can use the same rule as eslint-plugin-react-hooks.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Looks like #68269 (comment) just went out to prod 4 days ago. If that is what introduced this, could you guys take a look @thelullabyy@DylanDylann as this would still be within regression period
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.0-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@DylanDylann@joekaufmanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Aug 26, 2025
Triggered auto assignment to @joekaufmanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.nkdengineer commentedon Aug 26, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes when opening task share destination list.
What is the root cause of that problem?
We use
useReportIsArchivedthat subscribes auseOnyxinsideuseMemo, then the App crashes due to React's lifecycleApp/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Line 73 in f54a2c1
App/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Lines 40 to 50 in f54a2c1
What changes do you think we should make in order to solve the problem?
We need to get all
reportNameValuePairsinTaskShareDestinationSelectorModaland pass them toreportFilterfunctionApp/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Line 73 in f54a2c1
App/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Lines 40 to 50 in f54a2c1
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
ryntgh commentedon Aug 26, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Task - App crashes when opening task share destination list
What is the root cause of that problem?
useReportIsArchivedis being called inside anArray.reducewithin thereportFilterwhich cause a React Hooks rules violationApp/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Lines 40 to 48 in f54a2c1
When the workspace is deleted, the reports array changes, causing different numbers of
useReportIsArchivedhooks to be called on different renders, which breaks React hook consistency requirementWhat changes do you think we should make in order to solve the problem?
We can follow the pattern used in here to pre-compute archived reports at the component top level
TaskShareDestinationSelectorModalreportFilterto use the pre-computed set instead of calling the hookApp/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Lines 40 to 48 in f54a2c1
App/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Line 73 in f54a2c1
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
N/A
daledah commentedon Aug 26, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes when opening task share destination list.
What is the root cause of that problem?
We're using a hook inside a normal function here:
App/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Line 43 in f54a2c1
And that function is used inside a memo:
App/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Line 73 in f54a2c1
This violates React's rule of hooks and cause app crash.
What changes do you think we should make in order to solve the problem?
This change was added in #68269 to remove usage of
reportNameValuePairs. Following that rule, we should update to changereportFilterinto a hook instead.Implement like below
Use the hook inside
TaskShareDestinationSelectorModaland use it here insteadApp/src/pages/tasks/TaskShareDestinationSelectorModal.tsx
Lines 73 to 74 in f54a2c1
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We should add a new lint rule to detect violated usage of hooks. We can use the same rule as
eslint-plugin-react-hooks.What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
joekaufmanexpensify commentedon Aug 26, 2025
Looks like #68269 (comment) just went out to prod 4 days ago. If that is what introduced this, could you guys take a look @thelullabyy @DylanDylann as this would still be within regression period
thelullabyy commentedon Aug 27, 2025
@joekaufmanexpensify @DylanDylann Opened PR to handle this
joekaufmanexpensify commentedon Aug 27, 2025
Great. TY!
melvin-bot commentedon Aug 27, 2025
Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
joekaufmanexpensify commentedon Sep 1, 2025
PR on staging
[-]Task - App crashes when opening task share destination list[/-][+][Due for payment 2025-09-09] Task - App crashes when opening task share destination list[/+]melvin-bot commentedon Sep 2, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Sep 2, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.0-5 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 2025-09-09. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Sep 2, 2025
@DylanDylann @joekaufmanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
joekaufmanexpensify commentedon Sep 4, 2025
@DylanDylann could you handle checklist so we can prep for payment next week?
DylanDylann commentedon Sep 4, 2025
No, this is a regression from our PR. We can close it out
joekaufmanexpensify commentedon Sep 8, 2025
Sounds good!