App icon indicating copy to clipboard operation
App copied to clipboard

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

Open lanitochka17 opened this issue 1 year ago β€’ 20 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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): [email protected] Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User has saved search
  1. Launch New Expensify app
  2. Go to Search
  3. Tap on the dropdown
  4. Tap 3-dot menu next to the saved search
  5. Tap Rename
  6. Rename and save it
  7. Tap on the dropdown
  8. Tap 3-dot menu next to the saved search
  9. Tap Rename

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?

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [x] iOS: Native
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

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

lanitochka17 avatar Sep 30 '24 15:09 lanitochka17

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.

melvin-bot[bot] avatar Sep 30 '24 15:09 melvin-bot[bot]

@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 avatar Sep 30 '24 15:09 lanitochka17

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

lanitochka17 avatar Sep 30 '24 15:09 lanitochka17

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

drminh2807 avatar Sep 30 '24 16:09 drminh2807

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)

Nodebrute avatar Sep 30 '24 16:09 Nodebrute

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

github-actions[bot] avatar Sep 30 '24 16:09 github-actions[bot]

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

Nodebrute avatar Sep 30 '24 16:09 Nodebrute

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

melvin-bot[bot] avatar Oct 03 '24 18:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 07 '24 18:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 09 '24 18:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 11 '24 18:10 melvin-bot[bot]

@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] avatar Oct 14 '24 18:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 16 '24 18:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 31 '24 17:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 31 '24 17:10 melvin-bot[bot]

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.
  • We need to introduce a new param isViewingSearch for the route of SavedSearchRenamePage

  • the same param for getOverflowMenu function here and pass this to getRoute function

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

  • Pass isViewingSearch param to getOverflowMenu function here
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

  • Navigate to the search page with type UP if isViewingSearch param is true
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)

mkzie2 avatar Nov 01 '24 02:11 mkzie2

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

dukenv0307 avatar Nov 01 '24 07:11 dukenv0307

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

melvin-bot[bot] avatar Nov 01 '24 07:11 melvin-bot[bot]

πŸ“£ @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] avatar Nov 01 '24 23:11 melvin-bot[bot]

πŸ“£ @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 πŸ“–

melvin-bot[bot] avatar Nov 01 '24 23:11 melvin-bot[bot]

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Nov 07 '24 12:11 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.58-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/51925

If no regressions arise, payment will be issued on 2024-11-14. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] avatar Nov 07 '24 12:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 07 '24 12:11 melvin-bot[bot]

@dukenv0307 requires payment automatic offer (Reviewer)

@muttmuure FYI I receive payment via NewDot, I'll request there

dukenv0307 avatar Nov 18 '24 15:11 dukenv0307

BugZero Checklist:

  • [x] [Contributor] Classify the bug:
Bug classification

Source of bug:

  • [ ] 1a. Result of the original design (eg. a case wasn't considered)
  • [x] 1b. Mistake during implementation
  • [ ] 1c. Backend bug
  • [ ] 1z. Other:

Where bug was reported:

  • [x] 2a. Reported on production
  • [ ] 2b. Reported on staging (deploy blocker)
  • [ ] 2c. Reported on a PR
  • [ ] 2z. Other:

Who reported the bug:

  • [ ] 3a. Expensify user
  • [ ] 3b. Expensify employee
  • [ ] 3c. Contributor
  • [x] 3d. QA
  • [ ] 3z. Other:
  • [x] [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/48566/files#r1847608611

  • [x] [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: N/A

  • [x] [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. Yes

Regression Test Proposal Template
  • [ ] [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:

  1. Go to Search
  2. Tap on the dropdown
  3. Tap 3-dot menu next to the saved search
  4. Tap Rename
  5. Rename and save it
  6. Tap on the dropdown
  7. Tap 3-dot menu next to the saved search
  8. Tap Rename
  9. Verify rename page will open once

Do we agree πŸ‘ or πŸ‘Ž

dukenv0307 avatar Nov 19 '24 04:11 dukenv0307

@francoisl, @muttmuure, @Nodebrute, @dukenv0307 Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Nov 19 '24 09:11 melvin-bot[bot]

We already had a test suite for saved searches so I added new steps for that test (internal tracking issue: https://github.com/Expensify/Expensify/issues/445936)

This is ready for payment @muttmuure

francoisl avatar Nov 19 '24 18:11 francoisl

@Nodebrute - paid $250 for C

@dukenv0307 - $250 for C+

muttmuure avatar Nov 20 '24 16:11 muttmuure

$250 approved for @dukenv0307

JmillsExpensify avatar Dec 05 '24 14:12 JmillsExpensify