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
[Due for payment 2025-04-02] [$250] mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages #57824
Version Number: 9.1.9-0 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: N/A Email or phone of affected tester (no customers):ibellicotest+345@gmail.com Issue reported by: Applause Internal Team Device used: Motorola MotoG60 - Android 12 - Chrome App Component: Workspace Settings
Action Performed:
Prerequisite: At least one workspace should be already created on account.
Open the staging.new.expensify.com
Tap on "Settings" and select "Workspaces"
Tap on "New Workspace" button more than once.
When landing on "Confirm Workspace" page, tap on the arrow on the top left corner to return to workspaces list.
Check how many workspaces confirmation pages were opened.
Expected Result:
Only one workspace confirmation page should be opened despite tapping more than once on "New Workspace" button.
Actual Result:
Several workspace confirmation pages are opened if tapping more than once on "New Workspace" button.
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.
Please re-state the problem that we are trying to solve in this issue.
mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages
What is the root cause of that problem?
On the web, when clicking a button, we do not handling singleExecution as we do on native, so the onPress fired multiple time.
When a button is clicked, we navigate to the target screen. However, in this case, the navigation action is triggered multiple times.
Although we have logic to prevent navigation to the same screen, in the OP, we navigate with backTo, which causes the condition to evaluate as false, leading to multiple instances of the screen opening.
What changes do you think we should make in order to solve the problem?
Please re-state the problem that we are trying to solve in this issue.
mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages
What is the root cause of that problem?
On web, we do not prevent multiple clicks. We have logic to prevent navigation to the same screen but as soon as we hit the "New workspace" button, the Navigation.getActiveRoute() and due to that the url is not identified as same.
What changes do you think we should make in order to solve the problem?
This issue might occur elsewhere if reproduced with similar behavior. I haven't tested it, but I assume so. Therefore, I suggest two solutions: 1) a fix for this specific issue, and 2) a global fix.
A fix for this specific issue: We should call navigate only when activeRoute differs from newRoute
Global fix: We apply the same approach by checking if newRoute differs from activeRoute. If they are different, we allow navigation; otherwise, navigation is not needed (optional)
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
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.
changed the title [-]mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/-][+][$250] mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/+]on Mar 5, 2025
changed the title [-][$250] mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/-][+][Due for payment 2025-04-02] [$250] mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/+]on Mar 26, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.18-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@dominictb@greg-schroeder@dominictb 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]
[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: NA
[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
Precondition:
Account should not have any existing workspace
Test:
Open the workspace switcher.
Press the "Get Started" button multiple times in quick succession > Verify that only one Workspace Confirmation page opens.
Navigate back, then go to Settings > Workspaces.
Press the "New Workspace" button multiple times in quick succession > Verify that only one Workspace Confirmation page opens.
Press the back button and verify that you are correctly navigated back to the Workspaces list page.
Press "New Workspace," create the workspace, and then go back to the Workspaces list page.
Press the "New Workspace" button multiple times in quick succession > Verify that only one Workspace Confirmation page opens.
Press the back button > Verify that you are correctly navigated back to the Workspaces list page.
Activity
melvin-bot commentedon Mar 5, 2025
Triggered auto assignment to @greg-schroeder (
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 Mar 5, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-06 10:06:35 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Several workspace confirmation pages are opened if tapping more than once on "New Workspace" button.
What is the root cause of that problem?
In Workspace List page, we don't prevent multiple click on New workspace button
App/src/pages/workspace/WorkspacesListPage.tsx
Line 426 in ad7462d
What changes do you think we should make in order to solve the problem?
We can modify and use the logics added in this PR, which was implemented to fix this similar issue.
First, modify
useActiveRouteto use other Navigation methods instead of onlygetReportRHPActiveRouteHere's my initial pseudo code, this can be further improved if we get to the PR phase
Then use it in Workspace List page
Then we can use this hook to fix the similar bugs in other places.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Create a ref:
Update
onPressfor New workspace buttonAnd reset
isButtonPressedRefwhen Workspace List page gain focusReminder: 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.
linhvovan29546 commentedon Mar 5, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages
What is the root cause of that problem?
On the web, when clicking a button, we do not handling singleExecution as we do on native, so the onPress fired multiple time.
When a button is clicked, we navigate to the target screen. However, in this case, the navigation action is triggered multiple times.
App/src/hooks/useSingleExecution/index.ts
Line 10 in 4fe7c70
Although we have logic to prevent navigation to the same screen, in the OP, we navigate with backTo, which causes the condition to evaluate as false, leading to multiple instances of the screen opening.
What changes do you think we should make in order to solve the problem?
We can use debounce to prevent multiple click
App/src/pages/workspace/WorkspacesListPage.tsx
Line 426 in ad7462d
Optional: We can wrap this inside Button
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can write a test to verify that action is only executed one time times when clicking multiple times
What alternative solutions did you explore? (Optional)
n/A
Krishna2323 commentedon Mar 5, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages
What is the root cause of that problem?
Navigation.getActiveRoute()and due to that the url is not identified as same.App/src/libs/Navigation/helpers/linkTo/index.ts
Lines 102 to 105 in ad7462d
What changes do you think we should make in order to solve the problem?
Navigation.getActiveRoute()asbackTovalue, we can useROUTES.SETTINGS_WORKSPACES.App/src/pages/workspace/WorkspacesListPage.tsx
Line 426 in ad7462d
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A -- Navigation issue
What alternative solutions did you explore? (Optional)
isFocusedto prevent navigating when screen is not focused.huult commentedon Mar 5, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-06 02:08:18 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tapping New Workspace more than once, opens several WS confirmation pages
What is the root cause of that problem?
When we tap 'New Workspace' multiple times, the navigation is triggered repeatedly, causing this issue.
App/src/pages/workspace/WorkspacesListPage.tsx
Line 426 in c3afa5f
What changes do you think we should make in order to solve the problem?
This issue might occur elsewhere if reproduced with similar behavior. I haven't tested it, but I assume so. Therefore, I suggest two solutions: 1) a fix for this specific issue, and 2) a global fix.
App/src/pages/workspace/WorkspacesListPage.tsx
Line 426 in c3afa5f
update to:
const activeRoute = Navigation.getActiveRoute(); const newRoute = ROUTES.WORKSPACE_CONFIRMATION.getRoute(activeRoute); const extractBaseRoute = (route: string) => route.split('?').at(0); // or // const removeBacktoParam = (r: string) => r.replace(/([&?])backTo=[^&]+(&|$)/, (match, p1, p2) => (p1 === '?' && !p2 ? '' : p1)); // if (removeBacktoParam(activeRoute) === removeBacktoParam(`/${newRoute}`)) { if (extractBaseRoute(activeRoute) === extractBaseRoute(`/${newRoute}`)) { return; } Navigation.navigate(newRoute);Screen.Recording.2025-03-05.at.16.05.28.mov
App/src/libs/Navigation/Navigation.ts
Line 159 in 44dbdc1
add:
const activeRoute = getActiveRoute(); const removeBacktoParam = (r: string) => r.replace(/([&?])backTo=[^&]+(&|$)/, (match, p1, p2) => (p1 === '?' && !p2 ? '' : p1)); if (removeBacktoParam(activeRoute) === removeBacktoParam(`/${route}`)) { return; }What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
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.
[-]mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/-][+][$250] mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/+]melvin-bot commentedon Mar 5, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021897404729148638725
melvin-bot commentedon Mar 5, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dominictb (
External)22 remaining items
[-][$250] mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/-][+][Due for payment 2025-04-02] [$250] mWeb - Workspace - Tapping New Workspace more than once, opens several WS confirmation pages[/+]melvin-bot commentedon Mar 26, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 26, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.18-4 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-04-02. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 26, 2025
@dominictb @greg-schroeder @dominictb 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]
dominictb commentedon Mar 27, 2025
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: https://github.com/Expensify/App/pull/53845/files#r2017049175
[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: NA
[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
Precondition:
Test:
Do we agree 👍 or 👎
greg-schroeder commentedon Mar 31, 2025
Filed regression test, pending payment date
greg-schroeder commentedon Apr 2, 2025
Payment summary:
Contributor: @Krishna2323 - $250 - Upwork
C+: @dominictb - $250 - Upwork