-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-05-27] [$250] Categories - RHP header title does not change after updating category name offline #58351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Triggered auto assignment to @laurenreidexpensify ( |
🚨 Edited by proposal-police: This proposal was edited at 2025-03-13 09:37:48 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Categories - RHP header title does not change after updating category name offline What is the root cause of that problem?The header title was dependent on the route parameter App/src/pages/workspace/categories/CategorySettingsPage.tsx Lines 148 to 151 in 2496dfa
What changes do you think we should make in order to solve the problem?Instead of using the route parameter, directly use the category name from the policy data ( <HeaderWithBackButton
title={policyCategory.name}
onBackButtonPress={navigateBack}
/> What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We could create a test to ensure that the header updates immediately after the category name is changed, if needed What alternative solutions did you explore? (Optional)New-Expensify.mp4 |
🚨 Edited by proposal-police: This proposal was edited at 2025-03-13 09:53:25 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Categories - RHP header title does not change after updating category name offline What is the root cause of that problem?We are using categoryName from the route to show in header App/src/pages/workspace/categories/CategorySettingsPage.tsx Lines 148 to 151 in 2496dfa
But when we edit category, we back to route with old category name with App/src/pages/workspace/categories/EditCategoryPage.tsx Lines 58 to 65 in 2496dfa
What changes do you think we should make in order to solve the problem?We should use Navigation.setNavigationActionToMicrotaskQueue(() => {
Navigation.goBack(
isQuickSettingsFlow
? ROUTES.SETTINGS_CATEGORY_SETTINGS.getRoute(policyID, values.categoryName, backTo)
: ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(policyID, values.categoryName),
{compareParams: false},
);
}); What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?Minor UI bug, no need to test. If needed we can render category edit page with mock data and verify that route and header title is changed after we update category name What alternative solutions did you explore? (Optional)We can remove 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. |
Job added to Upwork: https://www.upwork.com/jobs/~021900183016820569237 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The RHP header title does not update. What is the root cause of that problem?We already have a logic to change the params and title when category are edited here: App/src/pages/workspace/categories/CategorySettingsPage.tsx Lines 65 to 70 in e0a699f
So navigating back using old category name is not the real RCA that caused the issue. When opening the Category edit page, the Category settings page is not removed from the screen, it's just hidden behind the edit page. This behavior makes the above When we edit the category name, changes in dependency triggers the effect, changing the params. However, user are still in the Category edit page, so the But why we still see the URL is updated when navigating back when online? Because we use App/src/libs/actions/Policy/Category.ts Lines 675 to 678 in e0a699f
And when API call sucessfully, we remove them: App/src/libs/actions/Policy/Category.ts Lines 709 to 711 in e0a699f
The latter update triggers the effect again, making When offline, What changes do you think we should make in order to solve the problem?Only change the title doesn't solve the whole problem because the URL is not changed. Navigating back using the updated category name is risky and not future proof, because BE might not accept the change and reset the old value. In this case user will get a Not found page. Instead, we should trigger the App/src/pages/workspace/categories/CategorySettingsPage.tsx Lines 65 to 70 in e0a699f
const isFocused = useIsFocused();
useEffect(() => {
if (policyCategory?.name === categoryName || !policyCategory || !isFocused) {
return;
}
navigation.setParams({categoryName: policyCategory?.name});
}, [categoryName, navigation, policyCategory, isFocused]); Optionally, set dependency only on useEffect(() => {
if (policyCategory?.name === categoryName || !isFocused) {
return;
}
navigation.setParams({categoryName: policyCategory?.name});
}, [categoryName?.name, navigation, policyCategory, isFocused]); What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We can create a test to simulate the edit category name flow and make sure that the title and url is correctly set. What alternative solutions did you explore? (Optional)NA 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. |
@getusha Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@getusha bump for review of these proposals thanks |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@getusha Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Reviewing |
Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@getusha what do you think about my proposal? it actually fixes both title and header errors with a simpler solution. And all the root causes in the selected proposal only happen because we are wrapping the cc @puneetlath |
@daledah, could you expand on this? I may have overestimated the validity of this case. |
First of all, as commented here:
Second, as I stated, if the BE don't accept the category update - which I haven't thought of any case right now, but we can't be so sure in the future, then the failure data here will be merged: App/src/libs/actions/Policy/Category.ts Lines 716 to 727 in 2496dfa
And the
Because we navigate back using the new category name, which doesn't exist anymore. So user will be hit with a not found page. I believe we're implementing the logics here the way it is to prevent such cases to happen. And finally, even we somehow have a confirmation that the point above will never happen - which is very optimistic IMO, using |
Will finalize today |
@daledah can we pin point which PR caused this exactly? |
I think it comes from #41722 as they implemented the trigger set params effect, and this logics is unchanged since then. |
@getusha Eep! 4 days overdue now. Issues have feelings too... |
Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Thanks for the detailed explanation @daledah |
📣 @daledah 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
This issue has not been updated in over 15 days. @puneetlath, @laurenreidexpensify, @getusha, @daledah eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Looks like the PR is on staging. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.46-12 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-05-27. 🎊 For reference, here are some details about the assignees on this issue:
|
@getusha @laurenreidexpensify @getusha 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] |
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.1.12-5
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Workspace Settings
Action Performed:
Expected Result:
The RHP header title will update.
Actual Result:
The RHP header title does not update.
It only updates after closing and reopening the RHP.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6769510_1741856108441.category.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @laurenreidexpensifyThe text was updated successfully, but these errors were encountered: