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-12-25] [$250] iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings #53600
Version Number: 9.0.71-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both 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):applausetester+kh1311020@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Launch ND or hybrid app.
Go to workspace settings.
Tap on the workspace chat under "Submit expenses using your workspace chat below"
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
We can use function closeAndNavigate here
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.
The issue involves [specific problem, e.g., "inconsistent form behavior causing incorrect submissions"], affecting [impact, e.g., "data reliability and user experience"].
What is the root cause of that problem?
Triggered by [root cause, e.g., "a race condition in asynchronous state management"].
What changes do you think we should make in order to solve the problem?
Refactor state management to handle async operations correctly.
Add validation checks at client/server levels.
Enhance error handling for better feedback and logging.
Update outdated dependencies.
Suggested Fix for the Filter Icon Handler
function onFilterIconPress() {
if (isExecuting) {
return; // Prevent multiple executions.
}
singleExecution(() => {
// Logic to show filter options
Navigation.navigate(ROUTES.SEARCH_FILTER); // Adjust as per your route setup.
})();
}
changed the title [-]iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/-][+][$250] iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/+]on Dec 6, 2024
// We are dismissing any modals that are open when the NotFound view is shown
Navigation.isNavigationReady().then(()=>{
Navigation.closeRHPFlow();
});
},[canAccessRoute,shouldShowNotFoundPage]);
If not, then we dismiss any RHP. For example, if the user opens a workspace as a member and tries to open the workspace categories setting, then the categories setting RHP will be dismissed and the not found page will show from the workspace categories list page.
In our case, we open the workspace's initial page. The active route becomes Workspace_Initial. However, the current canAccessRoute logic only checks for the sub-page route. So, when it compares the active route with itself, it fails because menuItems doesn't contain Workspace_Initial.
// On narrow layout, if we are on /search route we want to hide all central pane routes and show only the bottom tab navigator.
if(lastSearchCentralPane){
constfilteredRoute=filteredRoutes.at(0);
if(filteredRoute){
return{
stateToRender: {
...state,
index: 0,
routes: [filteredRoute],
},
searchRoute: lastSearchCentralPane,
};
}
}
So, the wasRendered logic in WorkspaceInitialPage won't work. And when we try to open the filter page, the previously "hidden" routes are added again to the stack and canAccessRoute becomes false which dismiss any RHP.
What changes do you think we should make in order to solve the problem?
We can update canAccessRoute to cover the case of the workspace's initial page itself.
// We are dismissing any modals that are open when the NotFound view is shown
Navigation.isNavigationReady().then(()=>{
Navigation.closeRHPFlow();
});
},[canAccessRoute,shouldShowNotFoundPage]);
When we open the workspace's initial page, the active route becomes Workspace_Initial. However, the current canAccessRoute logic only checks for the sub-page route - therefore when it compares the active route with itself, it fails because menuItems doesn't contain Workspace_Initial.
We actually have the logic to only run it once here, but when we open the search page, all routes are "hidden" as explained here. Because of this, the wasRendered logic in WorkspaceInitialPage won't work as expected -> when we try to open the filter page, the previously "hidden" routes are added back to the stack and canAccessRoute becomes false which will dismiss any RHP that we try to open (Filters).
Credits to bernhardoj for the RCA.
What changes do you think we should make in order to solve the problem?
We had a similar issue which I reviewed recently here where we navigated away from WorkspaceProfileSharePage to a report without dismissing the currently opened modal which caused a weird UI bug in the QR Code because the same modal would be opened twice.
A practical solution for this kind of issue which wouldn't break any other functionality is to simply replace the way we navigate away from WS to the report here:
Why dismissing the modal first fixes our issue ?
Because as explained in RCA, on narrow layout devices (native / mWeb) screens displayed in RHP act as a modal and by dismissing it when navigating to the report, all the conditions which lead to the Filters RHP to being able to open when clicked on in our case, will now work as expected.
I proposed the same solution for this issue and because this solution would fix both issues, if my solution is selected on any of the two issues -> we should put the other one on HOLD.
changed the title [-][$250] iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/-][+][HOLD for payment 2024-12-25] [$250] iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/+]on Dec 18, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.76-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@rayane-djouah@kadiealexander@rayane-djouah 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 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: N/A
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.
[@kadiealexander] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
#### Precondition:
- N/A
#### Test:
1. Go to Workspace Settings.
2. Tap the workspace chat under "Submit expenses using your workspace chat below".
3. Tap the search icon in the top-right corner.
4. Enter any text and search.
5. On the Search page, tap the Filters button.
6. Verify that the Filters button is responsive and the search filters modal is displayed.
Activity
melvin-bot commentedon Dec 4, 2024
Triggered auto assignment to @kadiealexander (
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 Dec 5, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Filter icon is not responsive.
What is the root cause of that problem?
We are using normal navigate here
App/src/pages/workspace/WorkspaceInitialPage.tsx
Line 456 in 0e28aa4
Search page is open on top of
workspaceInitiaPagesocanAccessRouteis incorrectly computedApp/src/pages/workspace/WorkspaceInitialPage.tsx
Lines 360 to 362 in 0e28aa4
And we get dismiss all RHP modal in this useEffect
App/src/pages/workspace/WorkspaceInitialPage.tsx
Lines 372 to 375 in 0e28aa4
What changes do you think we should make in order to solve the problem?
When workspace init is the only route in the navigator state. We can use navigate with a type of 'UP'
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
We can use function
closeAndNavigatehereReminder: 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.
saifelance commentedon Dec 5, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The issue involves [specific problem, e.g., "inconsistent form behavior causing incorrect submissions"], affecting [impact, e.g., "data reliability and user experience"].
What is the root cause of that problem?
Triggered by [root cause, e.g., "a race condition in asynchronous state management"].
What changes do you think we should make in order to solve the problem?
Suggested Fix for the Filter Icon Handler
Add Accessibility and Clickability Checks
What alternative solutions did you explore? (Optional)
[-]iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/-][+][$250] iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/+]melvin-bot commentedon Dec 6, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021864902077815200576
melvin-bot commentedon Dec 6, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rayane-djouah (
External)bernhardoj commentedon Dec 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The filter button is "unresponsive"
What is the root cause of that problem?
In WorkspaceInitialPage, we check to see if the active route of the sub-page of the workspace settings page is accessible.
App/src/pages/workspace/WorkspaceInitialPage.tsx
Lines 360 to 376 in 3baf965
If not, then we dismiss any RHP. For example, if the user opens a workspace as a member and tries to open the workspace categories setting, then the categories setting RHP will be dismissed and the not found page will show from the workspace categories list page.
In our case, we open the workspace's initial page. The active route becomes
Workspace_Initial. However, the currentcanAccessRoutelogic only checks for the sub-page route. So, when it compares the active route with itself, it fails becausemenuItemsdoesn't containWorkspace_Initial.We actually have the logic to run it only once.
App/src/pages/workspace/WorkspaceInitialPage.tsx
Lines 368 to 371 in 3baf965
But when we open the search page, all routes are "hidden".
App/src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/useStateWithSearch.ts
Lines 44 to 57 in 3baf965
So, the
wasRenderedlogic in WorkspaceInitialPage won't work. And when we try to open the filter page, the previously "hidden" routes are added again to the stack andcanAccessRoutebecomes false which dismiss any RHP.What changes do you think we should make in order to solve the problem?
We can update
canAccessRouteto cover the case of the workspace's initial page itself.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
ikevin127 commentedon Dec 7, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue
Filter icon is not responsive when navigating to Search via WS chat in WS settings.
What is the root cause of that problem?
Note
This issue is only present on narrow layout devices (native / mWeb) where screens displayed in RHP act as a modal.
App/src/pages/workspace/WorkspaceInitialPage.tsx
Lines 360 to 376 in 3baf965
When we open the workspace's initial page, the active route becomes
Workspace_Initial. However, the currentcanAccessRoutelogic only checks for the sub-page route - therefore when it compares the active route with itself, it fails becausemenuItemsdoesn't containWorkspace_Initial.We actually have the logic to only run it once here, but when we open the search page, all routes are "hidden" as explained here. Because of this, the
wasRenderedlogic inWorkspaceInitialPagewon't work as expected -> when we try to open the filter page, the previously "hidden" routes are added back to the stack andcanAccessRoutebecomesfalsewhich will dismiss any RHP that we try to open (Filters).Credits to bernhardoj for the RCA.
What changes do you think we should make in order to solve the problem?
We had a similar issue which I reviewed recently here where we navigated away from
WorkspaceProfileSharePageto a report without dismissing the currently opened modal which caused a weird UI bug in the QR Code because the same modal would be opened twice.A practical solution for this kind of issue which wouldn't break any other functionality is to simply replace the way we navigate away from WS to the report here:
App/src/pages/workspace/WorkspaceInitialPage.tsx
Line 457 in b595f5d
to use
Navigation.dismissModalinstead:Why dismissing the modal first fixes our issue ?
Because as explained in RCA, on narrow layout devices (native / mWeb) screens displayed in RHP act as a modal and by dismissing it when navigating to the report, all the conditions which lead to the Filters RHP to being able to open when clicked on in our case, will now work as expected.
Result video (before / after)
iOS: Native
before.mov
after.mov
ikevin127 commentedon Dec 7, 2024
Important
I proposed the same solution for this issue and because this solution would fix both issues, if my solution is selected on any of the two issues -> we should put the other one on HOLD.
cc @rayane-djouah
17 remaining items
[-][$250] iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/-][+][HOLD for payment 2024-12-25] [$250] iOS Search - Filter icon is not responsive when navigating to Search via WS chat in WS settings[/+]melvin-bot commentedon Dec 18, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Dec 18, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.76-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 2024-12-25. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Dec 18, 2024
@rayane-djouah @kadiealexander @rayane-djouah 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]
rayane-d commentedon Dec 26, 2024
BugZero Checklist:
Classify the bug:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
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/41665/files#r1898131293
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: N/A
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.
[@kadiealexander] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Do we agree 👍 or 👎
bfitzexpensify commentedon Dec 27, 2024
Payment summary:
@rayane-djouah due $250 for C+ work, paid via Upwork ✅
@bernhardoj due $250 for contributor work via NewDot manual request
bernhardoj commentedon Dec 28, 2024
Requested in ND.
JmillsExpensify commentedon Jan 8, 2025
$250 approved for @bernhardoj