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

[HOLD for payment 2024-07-24] [$250] Chat - Copying a message with a reply doesn't refocus on the composer #44078

Closed
1 of 6 tasks
lanitochka17 opened this issue Jun 20, 2024 · 30 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 20, 2024

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: 1.4.86-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: N/A
Email or phone of affected tester (no customers): abebemiherat@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to any chat and write a message
  2. Reply to the message and click on the header to navigate back
  3. Hover over the message and click the 'copy to clipboard' button

Expected Result:

The app should focus on the composer after copying

Actual Result:

The app doesn't focus on the composer after copying

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

Bug6519290_1718880662989.Screen_Recording_2024-06-20_at_3.47.23_AM.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0132ecedb1bbac288c
  • Upwork Job ID: 1803846769475546722
  • Last Price Increase: 2024-06-20
  • Automatic offers:
    • nkdengineer | Contributor | 102861722
Issue OwnerCurrent Issue Owner: @stephanieelliott
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 20, 2024
Copy link

melvin-bot bot commented Jun 20, 2024

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

@garrettmknight 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
Copy link
Author

We think that this bug might be related to #vip-vsp

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Jun 20, 2024
@melvin-bot melvin-bot bot changed the title Chat - Copying a message with a reply doesn't refocus on the composer [$250] Chat - Copying a message with a reply doesn't refocus on the composer Jun 20, 2024
Copy link

melvin-bot bot commented Jun 20, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 20, 2024
Copy link

melvin-bot bot commented Jun 20, 2024

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

@gijoe0295
Copy link
Contributor

gijoe0295 commented Jun 20, 2024

Proposal

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

The app doesn't focus on the composer after copying

What is the root cause of that problem?

This only happens in case the URL points to a report action (i.e. r/:reportID/:reportActionID).

After pressing the context menu item, we refocus the composer. But we early return if the active route is not the current report route (i.e. r/:reportID):

/** Do not trigger the refocusing when the active route is not the report route, */
if (!Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(Navigation.getTopmostReportId() ?? ''))) {
return;
}

But we didn't cover the case of report action linking.

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

Include the case of report action linking as well:

if (!Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(Navigation.getTopmostReportId() ?? '-1', Navigation.getTopmostReportActionId()))) {
    return;
}

@nkdengineer
Copy link
Contributor

Proposal

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

The app doesn't focus on the composer after copying

What is the root cause of that problem?

When we copy a message, we have a callback to focus to composer here.

hideContextMenu(true, ReportActionComposeFocusManager.focus);

But in the case the URL of report screen has reportActionID param, this check doesn't pass and then the composer isn't focused

if (!Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(Navigation.getTopmostReportId() ?? '-1'))) {
return;

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

This also doesn't work when we open report as a RHP from search screen. So we should check if the current route is the report screen or report screen RHP, we will re-focus on the composer. We can do like this (Here just an example implementation, we can optimize it or have other way with this idea in the PR phrase).

const navigationState = navigationRef?.current?.getState();
const routes = navigationState?.routes;
const currentRoute = routes?.[navigationState?.index ?? 0];
const params = currentRoute?.params;
const isReportScreen = params && 'screen' in params && typeof params.screen === 'string' ? (params?.screen === SCREENS.RIGHT_MODAL.SEARCH_REPORT || params?.screen === SCREENS.REPORT) : false

if (!isReportScreen) {
    return;
}

if (!Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(Navigation.getTopmostReportId() ?? '-1'))) {
return;

What alternative solutions did you explore? (Optional)

@rushatgabhane
Copy link
Member

@gijoe0295 your root cause makes sense. What would Navigation.getTopmostReportActionId() return?
Will this work if there is not reportActionID in the url?

@gijoe0295
Copy link
Contributor

@rushatgabhane it would return undefined and getRoute would return /r/:reportID only.

@rushatgabhane
Copy link
Member

rushatgabhane commented Jun 21, 2024

@gijoe0295's proposal LGTM
🎀 👀 🎀

Copy link

melvin-bot bot commented Jun 21, 2024

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

@nkdengineer
Copy link
Contributor

@rushatgabhane This proposal doesn't work when we do the same step in Search_Report screen. This report has another route pattern.

@nkdengineer
Copy link
Contributor

Screen.Recording.2024-06-21.at.18.00.43.mov

@luacmartins
Copy link
Contributor

@rushatgabhane can you check the latest comment above? Is the selected proposal still good?

Copy link

melvin-bot bot commented Jun 24, 2024

@garrettmknight, @luacmartins, @rushatgabhane 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 Jun 24, 2024
@garrettmknight
Copy link
Contributor

@rushatgabhane bump on this one when you get a chance.

@rushatgabhane
Copy link
Member

@nkdengineer yeah your proposal is iterating on the same root cause for another page. Which we wouldn't have found unless you had mentioned it

@melvin-bot melvin-bot bot removed the Overdue label Jun 24, 2024
@rushatgabhane
Copy link
Member

@gijoe0295's proposal fixes this issue, but @nkdengineer has identified another page that has this issue too.

@luacmartins who should we hire?

@luacmartins
Copy link
Contributor

I think we can hire @gijoe0295 since they pointed out the correct RCA for the issue. We can split the bounty 50/50 between @gijoe0295 and @nkdengineer since they both contributed to the fix.

Copy link

melvin-bot bot commented Jun 24, 2024

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

Copy link

melvin-bot bot commented Jun 24, 2024

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

@rushatgabhane
Copy link
Member

PR on production

@garrettmknight garrettmknight added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Jul 17, 2024
@garrettmknight garrettmknight changed the title [$250] Chat - Copying a message with a reply doesn't refocus on the composer [HOLD for payment 2024-07-24] [$250] Chat - Copying a message with a reply doesn't refocus on the composer Jul 17, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 23, 2024
@gijoe0295
Copy link
Contributor

gijoe0295 commented Jul 24, 2024

@garrettmknight @nkdengineer @rushatgabhane Before summarizing payment, I want to raise a discussion on the split share between me and the other contributor (50:50 currently).

IMO @nkdengineer contribution here is obviously valuable (I'm grateful for that) but comparing to my efforts to investigate the final working solution, the 50:50 split seems not convincing. Therefore I suggest a 75:25 share for me and @nkdengineer. What do you all think about it? I'm open for discussions!

@garrettmknight
Copy link
Contributor

Hey @gijoe0295 I appreciate your work on this. Since you were the one who actually coded it, I'm open to giving you 75% payment AND giving @nkdengineer 50%.

@garrettmknight
Copy link
Contributor

Payment Summary:

@rushatgabhane can you complete the checklist and request payment when you have?

@garrettmknight garrettmknight removed their assignment Jul 24, 2024
@garrettmknight garrettmknight added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 24, 2024
Copy link

melvin-bot bot commented Jul 24, 2024

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

@garrettmknight garrettmknight self-assigned this Jul 24, 2024
@garrettmknight
Copy link
Contributor

@stephanieelliott just handing this one off while I'm OOO next week - only awaiting the checklist. If it doesn't get done by the time I'm back I'll pick back up. Thanks!

@rushatgabhane
Copy link
Member

  1. The PR that introduced the bug has been identified. Link to the PR: Fix: App focuses back on composer even if RHN is open on copy link from app download link in about settings #29254

  2. 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/29254/files#r1692362674

  3. A discussion in #expensify-bugs 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.

  4. Determine if we should create a regression test for this bug. Yes

  5. If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again

       1. Go to any chat and write a message
       2. Reply to the message and click on the header to navigate back
       3. Focus the composer
       4. Hover/Tap and hold the message and click the 'copy to clipboard' button
       5. Verify that the composer is focused after copying
    

@JmillsExpensify
Copy link

$250 approved for @rushatgabhane

@stephanieelliott
Copy link
Contributor

Issue for new test case here! https://github.com/Expensify/Expensify/issues/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

8 participants