Track expense- Category list loads infinitely when categorizing expense from invited workspace
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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): [email protected] Issue reported by: Applause Internal Team
Action Performed:
- Go to staging.new.expensify.com
- [User A] Invite User B to workspace.
- [User B] Do not open workspace chat invited by User A.
- [User B] Go to self DM.
- [User B] Track a manual expense.
- [User B] Select Categorize it from the actionable whisper.
- [User B] Click on the invited workspace.
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:
- [x] Android: Standalone
- [x] Android: HybridApp
- [x] Android: mWeb Chrome
- [x] iOS: Standalone
- [x] iOS: HybridApp
- [x] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [x] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/18eb49b0-fe39-4192-8bad-259b8e0fabe4
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.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Category list loads infinitely when categorizing expense from invited workspace
What is the root cause of that problem?
This is a backend issue. We are unable to get policy categories.
What changes do you think we should make in order to solve the problem?
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:
https://github.com/Expensify/App/blob/4a7f23f1d84568464228392f737317b58a10dde4/src/pages/iou/request/step/IOURequestStepCategory.tsx#L87-L93
// 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');
};
POC
https://github.com/user-attachments/assets/e4457f1b-8c78-474a-9f50-e82fa196f17e
What alternative solutions did you explore? (Optional)
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]);
Triaged
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!
Waiting on proposals for this one
we have one proposal to review
@johncschuster this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@johncschuster Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
I couldn't action this today. I will check it out this weekend.
I'll work to find someone that can tackle this internally
@IuliiaHerets can I get a retest on this to see if it persists?
@johncschuster Tester can't repro this issue in the latest build
https://github.com/user-attachments/assets/4201a6b6-f175-4fd6-8a86-df930e0435f6
Great! In that case, let's close this up!