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 2023-06-01] [$1000] Mentions results does not close when we change focus #18879

Closed
2 of 6 tasks
kavimuru opened this issue May 12, 2023 · 40 comments
Closed
2 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented May 12, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open any report
  3. Add some text in beginning and add @ and type any letters to get mentions
  4. shift focus to start of compose box and observe mentions results are still visible
  5. Try same thing with emoji suggestion and observe that suggestions close when we shift focus

Expected Result:

App should close mention results on shifting focus like it does for emoji suggestions

Actual Result:

App does not close mention results on shifting focus

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.13-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

mention.does.not.close.on.focus.change.mp4
Recording.594.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683891760906869

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f6abecc2436476a9
  • Upwork Job ID: 1658751456085680128
  • Last Price Increase: 2023-05-17
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@hoangzinh
Copy link
Contributor

hoangzinh commented May 12, 2023

Proposal

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

Mentions results does not close when we change focus

What is the root cause of that problem?

When text selection change, we call this method to calculate list mention suggestion

calculateMentionSuggestion() {
if (this.state.selection.end < 1) {
return;
}

But it would be early exit if the current cursor (selection.end) is the first character.

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

Remove this early exit check will solve the problem.

What alternative solutions did you explore? (Optional)

Instead of do nothing and early exit if the cursor is the first character, we can reset suggestedMentions state before exit. Almost same with what we are doing with emojis when the comment is empty

if (!this.state.value) {
this.resetSuggestions();
return;
}

@hungvu193
Copy link
Contributor

Proposal

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

Mentions results does not close when we change focus

What is the root cause of that problem?

We are checking if the current selection is smaller than 1 then early return here:

if (this.state.selection.end < 1) {
return;
}

When user moves cursor before "@" character, the selection end is now 0, so the suggestion mentions isn't re-calculated which caused this issue.

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

In stead of early return here and do nothing, we should resetSuggestion then return:

         if (this.state.selection.end < 1) {
            this.resetSuggestions();
            return;
        }

What alternative solutions did you explore? (Optional)

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

@bfitzexpensify
Copy link
Contributor

Reproduced.

@melvin-bot melvin-bot bot removed the Overdue label May 17, 2023
@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label May 17, 2023
@melvin-bot melvin-bot bot changed the title Mentions results does not close when we change focus [$1000] Mentions results does not close when we change focus May 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Triggered auto assignment to @hayata-suenaga (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Santhosh-Sellavel
Copy link
Collaborator

Both proposals do not work, the suggestion list sometimes not closing

@hoangzinh
Copy link
Contributor

hi @Santhosh-Sellavel just want to ensure you have either:

as I mentioned in my proposal above, didn't you?

@Santhosh-Sellavel
Copy link
Collaborator

Yeah I tried both!

@Santhosh-Sellavel
Copy link
Collaborator

Will visit this again later today or tomorrow!

@hoangzinh
Copy link
Contributor

it's weird. Because it works properly in my local.
May-18-2023 06-26-14

@Santhosh-Sellavel
Copy link
Collaborator

Sorry for the confusion @hoangzinh. Not sure why it was behaving weirdly yesterday.
I tried testing this again, it looks good to me.

@hayata-suenaga

Let's hire @hoangzinh for this one.

Let's go with resetSuggestions() that's the better approach!

Let me know your thoughts.

C+ Reviewed
👀 🎀 👀

@hungvu193
Copy link
Contributor

hungvu193 commented May 19, 2023

@Santhosh-Sellavel can you review my proposal? i suggested to use resetSuggestion(). I remembered at the time I posted my proposal, @hoangzinh 's proposal only suggested to remove early return :/. Because if that proposal included my proposal, I'll never post my proposal. @hoangzinh can you confirm?

#18879 (comment)

@hoangzinh
Copy link
Contributor

I'm sorry @hungvu193. I think you can get answer by checking my edit history here #18879 (comment)

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label May 20, 2023
@hoangzinh
Copy link
Contributor

@Santhosh-Sellavel @hayata-suenaga PR is ready for the review #19334

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 25, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Mentions results does not close when we change focus [HOLD for payment 2023-06-01] [$1000] Mentions results does not close when we change focus May 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 25, 2023

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

If no regressions arise, payment will be issued on 2023-06-01. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 25, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
  • [@Santhosh-Sellavel] 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.
  • [@bfitzexpensify/@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 31, 2023
@bfitzexpensify
Copy link
Contributor

@Santhosh-Sellavel bump to complete the BZ checklist

@bfitzexpensify
Copy link
Contributor

Another friendly bump @Santhosh-Sellavel, I can pay out the C+ contract once the checklist is complete. Thanks!

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jun 3, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

Do we need Regression testing here @hayata-suenaga ? I think we don't need here let me know your thoughts and if you differ on anything above, thanks!

@hayata-suenaga
Copy link
Contributor

@Santhosh-Sellavel although if the same regression occurs it's likely the issue will be caught in other test suites, it will be a good idea to explicitly create a regression test for this

@bfitzexpensify
Copy link
Contributor

I agree, this feels like a common enough flow to warrant its own test.

@bfitzexpensify bfitzexpensify added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot

This comment was marked as duplicate.

@bfitzexpensify
Copy link
Contributor

Heading OOO for this week. @johncschuster — we're almost done here, there are two steps remaining:

  1. Once @Santhosh-Sellavel proposes the regression steps, we'll need to open an issue to have those added to Testrail
  2. We'll then need to pay out @Santhosh-Sellavel via https://www.upwork.com/ab/applicants/1658751456085680128/job-details - he's already been hired.

Thanks!

@johncschuster
Copy link
Contributor

Sounds good, @bfitzexpensify!

@Santhosh-Sellavel
Copy link
Collaborator

Regression Test Steps

  1. Open any report
  2. Add some text in beginning and add @ and type any letters to get mentions
  3. Move cursor to start of compose box
  4. Verify that mention suggestions is closed
  5. Move cursor to mention text
  6. Verify that mention suggestions is open

👍 or 👎

cc: @hayata-suenaga

@puneetlath
Copy link
Contributor

We're going to be adding a regression test suite for mentions soon, so I think you can probably go forward without it here.

@johncschuster
Copy link
Contributor

Thanks, @puneetlath! Should we capture the suggested regressions steps above, or do we already have a suite of initial testing steps already written?

@puneetlath
Copy link
Contributor

We're already working on it, so no need to worry about it.

@johncschuster
Copy link
Contributor

Perfect. Thanks!

BugZero checklist has been completed. Payment has been issued to everyone. Thanks, folks! 🎉

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants