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
[HOLD for payment 2024-11-28] [$250] Not found page appear briefly after updating the first approver #51282
When we change the first approval, we only update the data of approvalWorkflows without updating the route params so currentApprovalWorkflow will be empty => shouldShowNotFoundView = true
@JmillsExpensify I discovered this bug and have more context because I was also the main C+ on the approval workflow feature. I am happy to take this issue as C+ if it is external
This bug is handled on removing flow on #48089 and we also fix for this case where users update the first approver
When we open the page with the first approver of A, then update it to B, A won't be in the approver list anymore, so current approval workflow can't be found.
What changes do you think we should make in order to solve the problem?
Instead of using navigation focused state to prevent the not found page (which is not reliable IMO), we can prevent the current approval workflow data to be updated when we are submitting the update. To do that, we need 2 new ref.
changed the title [-]Not found page appear briefly after updating the first approver[/-][+][$250] Not found page appear briefly after updating the first approver[/+]on Oct 30, 2024
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Create a new workspace with at least 2 members
Enable workflow -> enable Add approvals
Change the first approver in the first approval workflow
Activity
melvin-bot commentedon Oct 22, 2024
Triggered auto assignment to @JmillsExpensify (
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.daledah commentedon Oct 22, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
not found pageis displayed brieflyWhat is the root cause of that problem?
In here, we have logic to calculate
currentApprovalWorkflowbase onapprovalWorkflowsandfirstApproverget from route paramsApp/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Line 87 in 04214cd
When we change the first approval, we only update the data of
approvalWorkflowswithout updating the route params socurrentApprovalWorkflowwill be empty =>shouldShowNotFoundView = trueApp/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Lines 92 to 93 in 04214cd
What changes do you think we should make in order to solve the problem?
We should close the modal before updating the
approvalWorkflowsdata usingInteractionManager.runAfterInteractionshere
App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Lines 53 to 54 in 04214cd
What alternative solutions did you explore? (Optional)
DylanDylann commentedon Oct 23, 2024
@JmillsExpensify I discovered this bug and have more context because I was also the main C+ on the approval workflow feature. I am happy to take this issue as C+ if it is external
This bug is handled on removing flow on #48089 and we also fix for this case where users update the first approver
bernhardoj commentedon Oct 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
A not found is shown after updating the first approver.
What is the root cause of that problem?
The not found will show if the current approval workflow isn't found.
App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Lines 92 to 93 in faf48fc
The current approval workflow finds the workflow where the approver is the same as the first approver route params.
App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Line 87 in faf48fc
When we open the page with the first approver of A, then update it to B, A won't be in the approver list anymore, so current approval workflow can't be found.
What changes do you think we should make in order to solve the problem?
Instead of using navigation focused state to prevent the not found page (which is not reliable IMO), we can prevent the current approval workflow data to be updated when we are submitting the update. To do that, we need 2 new ref.
isUpdatedReftells whether the user updates the data or not.prevApprovalDatacontains the previous approval workflow data.Set
isUpdatedRefto true when updating the data.App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Lines 41 to 55 in faf48fc
Store the approval data to
prevApprovalDataso we can use it later and return theprevApprovalDataifisUpdatedRefis true.App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Lines 70 to 89 in faf48fc
What alternative solutions did you explore? (Optional)
Prevent the not found from showing if the page isn't focused if we prefer that way.
melvin-bot commentedon Oct 25, 2024
@JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Oct 30, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021851668069597317065
[-]Not found page appear briefly after updating the first approver[/-][+][$250] Not found page appear briefly after updating the first approver[/+]melvin-bot commentedon Oct 30, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (
External)27 remaining items
DylanDylann commentedon Nov 28, 2024
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: [CP Staging][CRITICAL] Implement <WorkspaceWorkflowsApprovalsEditPage /> for Editing Workflow #47249 (comment)
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Nov 29, 2024
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
melvin-bot commentedon Dec 2, 2024
@deetergp, @JmillsExpensify, @daledah Huh... This is 4 days overdue. Who can take care of this?
JmillsExpensify commentedon Dec 3, 2024
Payment summary:
JmillsExpensify commentedon Dec 3, 2024
Regression test created and one contributor payment made.
melvin-bot commentedon Dec 9, 2024
@deetergp, @JmillsExpensify, @daledah Eep! 4 days overdue now. Issues have feelings too...
JmillsExpensify commentedon Dec 9, 2024
All paid out.