-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[HOLD for payment 2024-10-22] [$250] Workflow - Tapping add approval workflow or tapping back shows diff. behavior in mweb&android #50094
Comments
Triggered auto assignment to @garrettmknight ( |
@garrettmknight FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
ProposalPlease re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Lines 149 to 155 in 66d1025
We clear the approval workflow data before closing the modal. What changes do you think we should make in order to solve the problem?We should first call Navigation.goBack(); and only clear the data once the transition is complete.
|
Job added to Upwork: https://www.upwork.com/jobs/~021841560364430821283 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.In Android, tapping add approval workflow " No members to display " shown briefly but in mweb while tapping back button No members to display " page is shown What is the root cause of that problem?
App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Lines 149 to 156 in f325244
App/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx Lines 103 to 109 in 19a137d
What changes do you think we should make in order to solve the problem?
App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Lines 149 to 156 in f325244
App/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx Lines 103 to 109 in 19a137d
To do that we can use App/src/libs/actions/Workflow.ts Line 337 in 19a137d
Or we can return the App/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx Lines 103 to 109 in 19a137d
What alternative solutions did you explore? (Optional) |
Edited by proposal-police: This proposal was edited at 2024-10-02 20:22:02 UTC. ProposalPlease restate the problem we are trying to solve in this issue.Workflow - When tapping "Add Approval Workflow" or navigating back, the message "No members to display" is briefly shown. What is the root cause of the problem?When tapping the back button, the approval workflow object is set to App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Lines 149 to 156 in f325244
App/src/libs/actions/Workflow.ts Lines 340 to 342 in 9d252e8
shouldShowListEmptyContent variable to resolve to undefined , not false :App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Line 63 in 9d252e8
listEmptyContent if shouldShowListEmptyContent is true , the issue arises when shouldShowListEmptyContent is undefined . In such cases, the BaseSelectionList component uses a default value of true for shouldShowListEmptyContent :
undefined value is passed, the component interprets it as not provided, and defaults to true .
What changes should we make to solve the problem?We should ensure that the value passed is always a boolean, not App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Line 63 in 9d252e8
const shouldShowListEmptyContent = !!(approvalWorkflow && approvalWorkflow.availableMembers.length === 0); This ensures the empty page is only displayed when appropriate. we can do the same change in other arias that uses the now, we will have an issue where the members list becomes empty before navigating back. To address this, and the problem where the sections list becomes empty after clearing the members list, we can introduce a Changes:
const [isNavigatingBack, setIsNavigatingBack] = useState(false);
const previousAvailableMembers = usePrevious(approvalWorkflow?.availableMembers);
if (!approvalWorkflow?.members || isNavigatingBack) {
if (approvalWorkflow?.availableMembers ?? isNavigatingBack) {
const workflowAvailableMembers = (isNavigatingBack ? previousAvailableMembers : approvalWorkflow?.availableMembers) ?? [];
const availableMembers = workflowAvailableMembers
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Tapping add approval workflow or tapping back shows diff. behavior in mweb&android What is the root cause of that problem?First, we only clear the workflow when the user presses Go Back. The workflow will not be cleared if the user clicks on the central pane to navigate the workflow page. The second issue is that we encounter the member's empty state because of this. App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Lines 149 to 154 in 19a137d
What changes do you think we should make to solve the problem?We should remove this implementation from here. In this component App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Lines 149 to 154 in 19a137d
And then in
We can implement the same solution in other places too where we have this issue What alternative solutions did you explore? (Optional)In the alternative solution, we should also remove the and in here we can use App/src/libs/actions/Workflow.ts Lines 336 to 338 in 19a137d
|
ProposalPlease re-state the problem that we are trying to solve in this issue.An empty state view is shown when opening/closing the approval workflow page. What is the root cause of that problem?When we open the page, we will set the approval data first and then navigate to the page. App/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx Lines 103 to 108 in e61ee7f
However, the onyx data is not immediately available which is noticeable in slower devices like Android. And when we close the page, we clear the approval data. App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx Lines 149 to 154 in e61ee7f
What changes do you think we should make in order to solve the problem?For the first problem, we can use
For the second problem, we can delay the clearing of data using InteractionManager, just like we did here. App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx Lines 63 to 67 in e61ee7f
|
@cretadn22, @nkdengineer, @Nodebrute and @bernhardoj Thank you for the proposals. The RCA makes sense in general but the not found view should only be shown if the |
@abzokhattab Thanks for the proposal. The RCA makes sense. I find your solution the easiest to implement even though it will cause blank space to appear on animation instead of the not found view but I don't think thats something that we should optimize for. Overall looks good to me.
|
Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@abzokhattab Actually I found that the solution is not enough. We get a weird view after selecting some users and going back Screen.Recording.2024-10-03.at.7.12.54.PM.mov |
@s77rt The selected proposal is not enough because we still need to fix the approval workflow will be cleared briefly before we go back to the workflow page. |
Thanks @s77rt for the review, i extended my proposal to cover the other problem where the members list becomes empty when going back to solve it i used a help state the important this in my proposal is that it keeps the synchronous nature of clearing the data first then going back, not the other way around. POC Screen.Recording.2024-10-03.at.9.15.32.PM.mov |
Since we need another "complementary" solution, I'm giving this another review:
|
@abzokhattab The new changes making this more complex and it feels like band-aid solution |
I see, thanks for the review! |
@Nodebrute's proposal looks good to me |
@s77rt For the selected proposal, with the main or alternative we also need to use |
@nkdengineer I believe the key in @Nodebrute's proposal is to not call |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.48-2 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 2024-10-22. 🎊 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:
|
|
Payment summary:
|
Paid out in Upwork. @s77rt request when you're ready. |
Reopening for @s77rt and @garrettmknight to complete the regression checklist. |
@tgolen Completed here #50094 (comment) |
$250 approved for @s77rt |
Thanks @s77rt, and apologies that I missed it. @garrettmknight can you please be sure to copy those answers into the actual checklist and then complete it out? @s77rt Can you give a little more context behind the regression? Would you say it was caused by one of these?
|
I would say it's a bug that is introduced during implementation but it could also be that the design was incorrect if it was specific about the area where the bug occurred (I don't have access to the doc to confirm). |
This issue has not been updated in over 15 days. @garrettmknight, @s77rt, @stitesExpensify, @Nodebrute 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! |
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.43-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
While tapping add approval workflow or on tapping app back button "No members to display " page must not be shown
Actual Result:
In Android, tapping add approval workflow " No members to display " shown briefly but in mweb while tapping back button No members to display " page is shown
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6622365_1727889041861.Screenrecorder-2024-10-02-22-26-36-193_compress_1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @s77rtThe text was updated successfully, but these errors were encountered: