Open IuliiaHerets opened 1 day ago
Triggered auto assignment to @johncschuster (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.
Edited by proposal-police: This proposal was edited at 2024-11-21 13:54:21 UTC.
Category list loads infinitely when categorizing expense from invited workspace
This is a backend issue. We are unable to get policy categories.
To resolve this issue, we must update the backend or if we don't want to update it, we can use 'openReport' instead of fetching policy categories because categories are included in the response of openReport, and we can use them directly. Something like this:
// src/pages/iou/request/step/IOURequestStepCategory.tsx#L87
const fetchData = () => {
if (policy && policyCategories) {
return;
}
+ if (report?.reportID) {
+ Report.openReport(report?.reportID, report?.reportActionID);
+ }
Category.getPolicyCategories(report?.policyID ?? '-1');
};
we can create a new useEffect
to watch for when we call Category.getPolicyCategories(report?.policyID ?? '-1')
. If policyCategories
returns undefined
, we must call Report.openReport(report?.reportID, report?.reportActionID);
.
// src/pages/iou/request/step/IOURequestStepCategory.tsx#L86
useEffect(() => {
if (isLoadingOnyxValue(policyCategoriesRealResult) || isLoadingOnyxValue(policyCategoriesDraftResult)) {
return;
}
if (!policyCategories && report?.reportID) {
Report.openReport(report?.reportID, report?.reportActionID);
}
}, [policyCategories, policyCategoriesDraftResult, policyCategoriesRealResult, report?.reportActionID, report?.reportID]);
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.64-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y Email or phone of affected tester (no customers): applausetester+kh0711008@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Category list will load without issue.
Actual Result:
Category list loads infinitely when categorizing expense from invited workspace and the invited workspace chat has not been opened yet.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/18eb49b0-fe39-4192-8bad-259b8e0fabe4
View all open jobs on GitHub