Repository navigation
[$250] Key Navigation - Pressing CTRL+K in attachment and closing search, leads to different chat #48113
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on 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.@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
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
Lines 29 to 37 in e32430c
if (closeModals.length === 0) { return; } if (onModalClose) { closeModals[closeModals.length - 1](isNavigate); return; } closeModals[closeModals.length - 1](); }
the onModalClose in this case is this
App/src/pages/home/report/ReportAttachments.tsx
Lines 41 to 44 in e32430c
onModalClose={() => { Navigation.dismissModal(); // This enables Composer refocus when the attachments modal is closed by the browser navigation ComposerFocusManager.setReadyToFocus();
WhichdismissModaland it will pop the report attachment modal route but thisonModalClosewill be called again viaonModalDidClose(because the modal itself calls theonModalDidCloseon itsonModalHide)
Lines 52 to 57 in e32430c
function onModalDidClose() { if (!onModalClose) { return; } if (closeModals.length) { closeTop();
so another pop on the route will navigate the user to another reportWhat changes do you think we should make in order to solve the problem?
The closeTop here
Line 57 in e32430c
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 incloseTop
So incloseTophere, we need to pop the lastcloseModalsafter 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
Lines 28 to 37 in e32430c
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)
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Aug 30, 2024 Job added to Upwork: https://www.upwork.com/jobs/~01212d967034d02032
- 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[/+]on Aug 30, 2024 - addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Aug 30, 2024 Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)38 remaining items
@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.goBackbeing called without fallbackRoute because we haven't passedshouldEnforceFallbacktrue. We have options to solve this- We can use dismissModal with report id here
App/src/pages/TransactionReceiptPage.tsx
Line 68 in a99cf94
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 goBackNavigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(report?.reportID ?? '-1'), true);Reacted by DylanDylann- We can use dismissModal with report id here
@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!
Triggered auto assignment to @carlosmiceli, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
- removedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on 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!
📣 @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 📖- addedReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2and removedDailyKSv2KSv2
on Sep 25, 2024 @CortneyOfstad This is ready for payment. The PR is deployed to production on 1/10
Payment Summary
@DylanDylann — paid $250 via Upwork
@FitseTLT — pid $250 via Upwork
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsNo status
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.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:
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?
Screenshots/Videos
Add any screenshot/video evidence
Bug6584145_1724765287823.CTRL_K.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @DylanDylann