Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Key Navigation - Pressing CTRL+K in attachment and closing search, leads to different chat #48113

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 27, 2024 · 39 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 27, 2024

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.25-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4891152&group_by=cases:section_id&group_order=asc&group_id=229066
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the staging.new.expensify website
  2. Open any chat in which an attachment was sent
  3. Click the attachment to open preview modal
  4. Press CTRL+K to open search page
  5. Dismiss the opened search page
  6. Verify if you are redirected to the correct chat

Expected Result:

When the user opens the preview modal of an attachment in any chat, presses CTRL+K and closes the search page, the website should return to the same chat where the user was in

Actual Result:

After the user opens the preview modal of an attachment in any chat, presses CTRL+K and closes the search page, is redirected to a different chat

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6584145_1724765287823.CTRL_K.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01212d967034d02032
  • Upwork Job ID: 1829648537564304374
  • Last Price Increase: 2024-09-20
  • Automatic offers:
    • DylanDylann | Reviewer | 104123548
    • FitseTLT | Contributor | 104123550
Issue OwnerCurrent Issue Owner: @DylanDylann
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

Triggered auto assignment to @kevinksullivan (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
Copy link
Author

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

@FitseTLT
Copy link
Contributor

FitseTLT commented Aug 27, 2024

Edited by proposal-police: This proposal was edited at 2024-08-27 20:45:56 UTC.

Proposal

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

Key Navigation - Pressing CTRL+K in attachment and closing search, leads to different chat

What is the root cause of that problem?

When press the shortcut key Modal.close will be called here

Modal.close(Session.checkIfActionIsAllowed(() => Navigation.navigate(ROUTES.CHAT_FINDER)));

This will call the modal onClose here
if (closeModals.length === 0) {
return;
}
if (onModalClose) {
closeModals[closeModals.length - 1](isNavigate);
return;
}
closeModals[closeModals.length - 1]();
}

the onModalClose in this case is this
onModalClose={() => {
Navigation.dismissModal();
// This enables Composer refocus when the attachments modal is closed by the browser navigation
ComposerFocusManager.setReadyToFocus();

Which dismissModal and it will pop the report attachment modal route but this onModalClose will be called again via onModalDidClose (because the modal itself calls the onModalDidClose on its onModalHide)
function onModalDidClose() {
if (!onModalClose) {
return;
}
if (closeModals.length) {
closeTop();

so another pop on the route will navigate the user to another report

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

The closeTop here

closeTop();

was intended to chain close multiple modals so that the onClose of the next modal will be called on the onModalDidClose of the current modal but we haven't poped the last onClose after calling it in closeTop
So in closeTop here, we need to pop the last closeModals after it is called becasue there is no need to call the onClose of the topmost modal again after it is called (because calling it by itself means we have closed the modal) here
function closeTop() {
if (closeModals.length === 0) {
return;
}
if (onModalClose) {
closeModals[closeModals.length - 1](isNavigate);
return;
}
closeModals[closeModals.length - 1]();
}

    if (onModalClose) {
        closeModals[closeModals.length - 1](isNavigate);
        closeModals.pop();
        return;
    }
    closeModals[closeModals.length - 1]();
    closeModals.pop();

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Aug 29, 2024
@kevinksullivan kevinksullivan added the External Added to denote the issue can be worked on by a contributor label Aug 30, 2024
Copy link

melvin-bot bot commented Aug 30, 2024

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

@melvin-bot melvin-bot bot changed the title Key Navigation - Pressing CTRL+K in attachment and closing search, leads to different chat [$250] Key Navigation - Pressing CTRL+K in attachment and closing search, leads to different chat Aug 30, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 30, 2024
Copy link

melvin-bot bot commented Aug 30, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 30, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

@kevinksullivan, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Sep 3, 2024
@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 4, 2024

@FitseTLT Could you reproduce this issue anymore?

Screen.Recording.2024-09-04.at.12.42.50.mov

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2024
@FitseTLT
Copy link
Contributor

FitseTLT commented Sep 4, 2024

@DylanDylann The reason you are not reproducing it for report attachment is because of this pr which tried to solve the same problem with wrong RCA and wrong solution. So instead of solving the issue from the root cause they applied a partial fix to report attachment so the problem still exists for other modals such as receipt attachment (Transaction Receipt), here is a video:
the page navigates back from transaction details page to the iou report page when CTRL+K, so I suggest we revert that fix and apply the right fix that solves problem from the root cause.

2024-09-04.14-43-22.mp4

Copy link

melvin-bot bot commented Sep 6, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Sep 6, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

@kevinksullivan, @DylanDylann Huh... This is 4 days overdue. Who can take care of this?

@DylanDylann
Copy link
Contributor

On my list today

@DylanDylann
Copy link
Contributor

@kevinksullivan I think this should be handled in #46388 I added a comment to the original issue. We can close this one

@melvin-bot melvin-bot bot removed the Overdue label Sep 10, 2024
@FitseTLT
Copy link
Contributor

@DylanDylann the issue is payedout/closed and way past its regression period, how is that suppose to be handled there while I have found the correct root cause and solution here.

CC @kevinksullivan

Copy link

melvin-bot bot commented Sep 10, 2024

@kevinksullivan @DylanDylann this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@thienlnam
Copy link
Contributor

@dominictb / @allgandalf Can you comment on the proposal? Ideally, if this can resolve all cases - we should undo the fix and have this fixed universally

@CortneyOfstad
Copy link
Contributor

@DylanDylann where are we at with this?

Copy link

melvin-bot bot commented Sep 17, 2024

@CortneyOfstad, @DylanDylann Eep! 4 days overdue now. Issues have feelings too...

@DylanDylann
Copy link
Contributor

@dominictb @allgandalf Bump on this comment: #48113 (comment)

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2024
@allgandalf
Copy link
Contributor

Sorry, I mostly rely on K2 and do not open mail often, so missed this pin.

@DylanDylann I am a little confused by that comment? can you brief about what the issue is here? thanks

@DylanDylann
Copy link
Contributor

@allgandalf Here: #48113 (comment) Please help to check

@allgandalf
Copy link
Contributor

I have notified the contributor to take a look at this one on slack

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 20, 2024

@allgandalf @dominictb Thanks for your response. Hmm, I think we will handle the new bug that @FitseTLT mentioned here separately. It is hard to say this is a regression from the previous PR because this bug is in another place and isn't known at that time. The previous issue also be closed 2 weeks ago.

I will review @FitseTLT's proposal and handle it as a new issue

Copy link

melvin-bot bot commented Sep 20, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Sep 23, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Sep 23, 2024
@DylanDylann
Copy link
Contributor

@dominictb Would you like to post your proposal to fix this bug globally on this issue? It looks promising

@melvin-bot melvin-bot bot removed the Overdue label Sep 24, 2024
@DylanDylann
Copy link
Contributor

@FitseTLT The same bug still happen when reloading page

Screen.Recording.2024-09-24.at.16.40.04.mov

@FitseTLT
Copy link
Contributor

@FitseTLT The same bug still happen when reloading page

Screen.Recording.2024-09-24.at.16.40.04.mov

@DylanDylann What you found here is a totally different bug that is not occuring because onMOdalHide is being called twice as the main bug here but it is caused by Navigation.goBack being called without fallbackRoute because we haven't passed shouldEnforceFallback true. We have options to solve this

  1. We can use dismissModal with report id here
    Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(report?.reportID ?? '-1'));
                Navigation.dismissModal(report?.reportID ?? '-1');

Because dismissModal correctly handles the case of transaction receipt page here ( and also dismissModal is the most appropriate as we are dismissing a modal)

case SCREENS.TRANSACTION_RECEIPT:

2. We can also pass shouldEnforceFallback to goBack

                Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(report?.reportID ?? '-1'), true);

Copy link

melvin-bot bot commented Sep 24, 2024

@CortneyOfstad @DylanDylann this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 25, 2024

Let's go with @FitseTLT's proposal. I the PR phase, please include the change to address this bug

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 25, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

📣 @DylanDylann 🎉 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

Copy link

melvin-bot bot commented Sep 25, 2024

📣 @FitseTLT 🎉 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 📖

@DylanDylann
Copy link
Contributor

@CortneyOfstad This is ready for payment. The PR is deployed to production on 1/10

@CortneyOfstad
Copy link
Contributor

Payment Summary

@DylanDylann — paid $250 via Upwork
@FitseTLT — pid $250 via Upwork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Status: No status
Development

No branches or pull requests

8 participants