Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.52k stars 2.87k forks source link

[$250] iOS Search - Rename page opens twice when renaming search and opening Rename page again #49943

Open lanitochka17 opened 1 month ago

lanitochka17 commented 1 month ago

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.41-3 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 Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

Expected Result:

Rename page will open once

Actual Result:

Rename page opens twice. Another one is in the background of the current Rename page

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/22d7969e-157b-401a-af1a-4d8b5495ac08

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021852037932647375330
  • Upwork Job ID: 1852037932647375330
  • Last Price Increase: 2024-10-31
  • Automatic offers:
    • dukenv0307 | Reviewer | 104702512
    • Nodebrute | Contributor | 104702515
Issue OwnerCurrent Issue Owner: @dukenv0307
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @muttmuure (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.

lanitochka17 commented 1 month ago

@muttmuure 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

lanitochka17 commented 1 month ago

We think that this bug might be related to #wave-control

drminh2807 commented 1 month ago

Edited by proposal-police: This proposal was edited at 2024-09-30 16:24:52 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

iOS Search - Rename page opens twice when renaming search and opening Rename page again

What is the root cause of that problem?

We haven't dismiss modal yet

What changes do you think we should make in order to solve the problem?

Add Navigation.dismissModal(); in https://github.com/Expensify/App/blob/main/src/pages/Search/SavedSearchRenamePage.tsx#L27-L34

What alternative solutions did you explore? (Optional)

N/A

Nodebrute commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Rename page opens twice when renaming search and opening Rename page again

What is the root cause of that problem?

We are not dismissing the modal while navigating to central pane here https://github.com/Expensify/App/blob/a9224f30ef9643644d20a90bc4488371c5f542ff/src/pages/Search/SavedSearchRenamePage.tsx#L28-L33

What changes do you think we should make in order to solve the problem?

We can add Navigation.dismissModal() here https://github.com/Expensify/App/blob/a9224f30ef9643644d20a90bc4488371c5f542ff/src/pages/Search/SavedSearchRenamePage.tsx#L28-L33

   const applyFiltersAndNavigate = () => {
        SearchActions.clearAdvancedFilters();
        Navigation.dismissModal();
        Navigation.navigate(
            ROUTES.SEARCH_CENTRAL_PANE.getRoute({
                query: q,
                name: newName,
            }),
        );
    };

What alternative solutions did you explore? (Optional)

github-actions[bot] commented 1 month ago

@user Your proposal will be dismissed because you did not follow the proposal template.

Nodebrute commented 1 month ago

Note for C+ we both posted the proposal in almost the same second and this is @drminh2807's proposal before edits

Screenshot 2024-09-30 at 9 25 01β€―PM
melvin-bot[bot] commented 1 month ago

@muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 4 weeks ago

@muttmuure Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] commented 3 weeks ago

@muttmuure 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

melvin-bot[bot] commented 3 weeks ago

@muttmuure 10 days overdue. I'm getting more depressed than Marvin.

melvin-bot[bot] commented 3 weeks ago

@muttmuure this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] commented 2 weeks ago

This issue has not been updated in over 14 days. @muttmuure eroding to Weekly issue.

melvin-bot[bot] commented 5 days ago

Job added to Upwork: https://www.upwork.com/jobs/~021852037932647375330

melvin-bot[bot] commented 5 days ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (External)

mkzie2 commented 4 days ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Rename page opens twice. Another one is in the background of the current Rename page

What is the root cause of that problem?

We navigate to the new query search page without dismissing the rename page.

https://github.com/Expensify/App/blob/6763f1a114817c059426c7304b605e1e31cdaa10/src/pages/Search/SavedSearchRenamePage.tsx#L28

Another problem is the old search page with the old query name still appears if we click on back button twice after renaming a saved search.

What changes do you think we should make in order to solve the problem?

  1. We should dismiss the modal before navigating to the search page with the new query name
Navigation.dismissModal();

https://github.com/Expensify/App/blob/6763f1a114817c059426c7304b605e1e31cdaa10/src/pages/Search/SavedSearchRenamePage.tsx#L28

  1. If the current viewing search is the renaming search we should navigate with type UP to remove the old search page from the navigation stack.
Navigation.navigate(ROUTES.SEARCH_SAVED_SEARCH_RENAME.getRoute({name: encodeURIComponent(itemName), jsonQuery: inputQuery, isViewingSearch}));

https://github.com/Expensify/App/blob/6763f1a114817c059426c7304b605e1e31cdaa10/src/libs/SearchUIUtils.ts#L485

menuItems={SearchUIUtils.getOverflowMenu(
    item.title ?? '',
    Number(item.hash ?? ''),
    item.query ?? '',
    showDeleteModal,
    true,
    closeMenu,
    currentSavedSearch?.hash === item.hash,
)}

https://github.com/Expensify/App/blob/6763f1a114817c059426c7304b605e1e31cdaa10/src/pages/Search/SearchTypeMenuNarrow.tsx#L144

Navigation.navigate(
    ROUTES.SEARCH_CENTRAL_PANE.getRoute({
        query: q,
        name: newName?.trim(),
    }),
    isViewingSearch === 'true' ? CONST.NAVIGATION.TYPE.UP : undefined
);

https://github.com/Expensify/App/blob/6763f1a114817c059426c7304b605e1e31cdaa10/src/pages/Search/SavedSearchRenamePage.tsx#L28

What alternative solutions did you explore? (Optional)

dukenv0307 commented 4 days ago

Thanks for all your proposals. @Nodebrute's proposal is the first to point out the correct RCA and solution.

@mkzie2 I think the bug you mentioned is not really related to this issue, so we should fix it in another issue (I'll report it).

Let's go with @Nodebrute's solution

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 4 days ago

Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 3 days ago

πŸ“£ @dukenv0307 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 3 days ago

πŸ“£ @Nodebrute πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–