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-10-09] [$500] Chat - User suggestion @ list not appearing on the second #26197

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 29, 2023 · 49 comments
Closed
1 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

@lanitochka17
Copy link

lanitochka17 commented Aug 29, 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. Launch app
  2. Tap on any report
  3. Enter @ and from suggestions select an user
  4. Tap enter key
  5. Enter @

Expected Result:

User suggestions @ list must appear on the second line

Actual Result:

User suggestions @ list not appearing on the second line and only a jump can be seen above composer

Workaround:

Unknown

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: 1.3.58-1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

secongtime.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause Internal team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01787235515a8ea167
  • Upwork Job ID: 1698842683423707136
  • Last Price Increase: 2023-09-11
  • Automatic offers:
    • cubuspl42 | Reviewer | 26685579
    • bernhardoj | Contributor | 26685580
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 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

@bernhardoj
Copy link
Contributor

bernhardoj commented Aug 29, 2023

Proposal

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

Typing the second 'at' (@) won't show the mention suggestion.

What is the root cause of that problem?

In our composer, we set an onScroll callback that will hide the suggestion.

onScroll={updateShouldShowSuggestionMenuToFalse}

On Android, when we type the @ in a new line input height changes and it will trigger the onScroll which then hides the suggestion. So, we can briefly see the suggestion animation shows and then immediately hides. On iOS, we can only reproduce this when the composer reaches the maximum line and typing @ moves to the new line. See the video below.

Screen.Recording.2023-08-29.at.22.28.28.mov

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

I suggest to remove the onScroll callback to prevent any unintended side effect.

What alternative solutions did you explore? (Optional)

Ignore the onScroll callback if the scrolled is triggered by adding a text to the composer. To do that, we would need to:

  1. Create a new ref that holds a bool value to decide whether we should ignore the onScroll or not.
  2. In updateComment, set the ref value to be true
  3. In onScroll callback function (updateShouldShowSuggestionMenuToFalse), if the ref value is true, do an early return and set the ref value to false.
    const updateShouldShowSuggestionMenuToFalse = useCallback(() => {
    if (!suggestionsRef.current) {
    return;
    }
    suggestionsRef.current.updateShouldShowSuggestionMenuToFalse(false);
    }, [suggestionsRef]);
  4. Last, we need to wrap updateShouldShowSuggestionMenuToFalse with a debounce with a 200ms interval because onScroll is triggered multiple times on typing a text.

@alexpensify
Copy link
Contributor

I will review soon

@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Sep 4, 2023
@melvin-bot melvin-bot bot changed the title Chat - User suggestion @ list not appearing on the second [$500] Chat - User suggestion @ list not appearing on the second Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

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

melvin-bot bot commented Sep 4, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@alexpensify
Copy link
Contributor

I confirmed this is a bug and don't believe it's a duplicate.

@cubuspl42 when you get a chance, can you review if the recent proposal will fix this issue? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@jeet-dhandha
Copy link
Contributor

jeet-dhandha commented Sep 5, 2023

Proposal

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

  • Mention is not showing up when entering in composer.

What is the root cause of that problem?

  • The root cause is that the mention is being closed when updateShouldShowSuggestionMenuToFalse is called due to onScroll event which is triggered when the user presses enter for a new line.

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

  • We should introduce a isWebDesktop flag which checks if the platform is Web/Desktop and browser is not mobile.
  • Then we will add a new prop to Composer onTouchMove and then we will update onScroll and onTouchMove like below.
const isWebDesktop = _.contains([CONST.PLATFORM.WEB, CONST.PLATFORM.DESKTOP], getPlatform()) && !Browser.isMobile();
<Composer
    {...rest}
    onTouchMove={!isWebDesktop ? updateShouldShowSuggestionMenuToFalse : undefined}
    onScroll={isWebDesktop ? updateShouldShowSuggestionMenuToFalse : undefined}
/>

What alternative solutions did you explore? (Optional)

  • N/A

@cubuspl42
Copy link
Contributor

@jeet-dhandha

[...] due to onScroll event which is triggered when the user presses enter for a new line.

To the best of my understanding, this is not what happens. The problem occurs later.

@bernhardoj

On Android, when we type the @ in a new line input height changes

This is the actual root cause, wouldn't you agree? Did you try attacking that in any way?

@bernhardoj
Copy link
Contributor

@cubuspl42 yes, but I'm not trying to tackle the input height change issue here as onScroll will also be triggered when the input reaches the max line and wraps to the next line (as shown in the video on my proposal).

@cubuspl42
Copy link
Contributor

@bernhardoj I understand. What worries me is that the callback we're talking about was probably added for some reason, and removing it blindly sounds a bit worrying. Do you have any idea what was the original intention, and why is it outdated?

@jeet-dhandha
Copy link
Contributor

If i were to combine your suggested root cause with my solution would it be selected @cubuspl42 ?

@cubuspl42
Copy link
Contributor

@jeet-dhandha I'm not sure yet, but I'm not a big fan of either solution. Both proposals seem not to reason much about the original intention behind the removed/modified functionality.

I guess that the functionality exists to hide the suggestions when the view is scrolled by hand. In our case, the scroll event is "artificial", generated by the scroll view itself based on layout changes.

A clean solution would detect this "artificial" scroll event related to expanding text and treat it differently from the organic one (when the user scrolls the view with a gesture).

If this is not possible directly, we can fallback to a non-perfect but probably practical solution, when all scroll events without time window t after each change in the text is considered "artificial".

@bernhardoj
Copy link
Contributor

I guess that the functionality exists to hide the suggestions when the view is scrolled by hand

This is my guess too, but I scanned through the issue and PR conversation and found nothing about the scroll requirement, so I posted my solution hoping the assigned C+ here has some context 😅. In this case, I would like to ask for the PR author to get some confirmation.

@perunt hi, for context, we are having an issue where when a text in a text input is wrapped to a new line, it triggers the onScroll which hides the suggestion.

onScroll={updateShouldShowSuggestionMenuToFalse}

I saw that this is introduced along with the static emoji suggestion feature. So, as the PR author of the emoji suggestion, would you mind sharing some information on why we are hiding the suggestion on text input scroll? Is it something intentional that is required by the feature? Thanks! 🙇

@alexpensify
Copy link
Contributor

@cubuspl42 have you been able to review the most recent reply from @bernhardoj? Thanks for the updates!

@cubuspl42
Copy link
Contributor

cubuspl42 commented Sep 8, 2023

@bernhardoj I'm just not convinced by removing the functionality because it doesn't suit us in the context of a given issue.

No matter if it was ever formally requested, the updateShouldShowSuggestionMenuToFalse functionality makes sense to me. When the user manually scrolls the composer, it's kind of like they "discard" the suggestion; maybe they're looking for something in the scrollback of their own composed message. The suggestion list is not strictly relevant to them anymore, so it makes sense it disappears.

So neither removing it completely (@bernhardoj) nor special casing it based on a last character in the buffer (@jeet-dhandha) doesn't seem like a clean approach to me.

I still believe that a clean solution would be treating user-triggered scrolls and scrolls being an effect of inputted characters separately. And yes, even if the solution would be based on classifying scroll events based on whether they occur in a given small time window since last text change.

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

melvin-bot bot commented Sep 15, 2023

📣 @cubuspl42 🎉 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
Copy link

melvin-bot bot commented Sep 15, 2023

📣 @bernhardoj 🎉 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 melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 15, 2023
@bernhardoj
Copy link
Contributor

PR is ready

cc: @cubuspl42

@alexpensify
Copy link
Contributor

PR is moving forward!

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @bernhardoj got assigned: 2023-09-15 02:53:43 Z
  • when the PR got merged: 2023-09-26 07:15:25 UTC
  • days elapsed: 7

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 2, 2023
@melvin-bot melvin-bot bot changed the title [$500] Chat - User suggestion @ list not appearing on the second [HOLD for payment 2023-10-09] [$500] Chat - User suggestion @ list not appearing on the second Oct 2, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 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-10-09. 🎊

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

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

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 Oct 2, 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:

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

@alexpensify
Copy link
Contributor

@cubuspl42 - to prepare for the payment date, can you please complete the checklist? Thanks!

@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
    • It seems that the bug was present in the relevant components since they were created
  • 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:
    • N/A
  • 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:
    • No need for additional discussion
  • Determine if we should create a regression test for this bug.
    • Up to the QA team
  • 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.
    • Open any report.
    • Type a message on the first line in the composer, then press Enter to proceed to the second line.
    • Enter "@" at the beginning of the second line.
    • Make sure a suggestion menu appears.
    • Incorporate multiple new lines into the composer to enable scrolling.
    • Add sufficient text such that the cursor reaches the end of the line, ending it with a space.
    • Input "@" again; this time it should appear on the subsequent line.
    • Verify the appearance of the suggestion list once more.
    • Manually scroll through the composer.
    • Confirm that the suggestion menu vanishes after the scroll action.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Oct 9, 2023
@alexpensify
Copy link
Contributor

Here is the payment summary:

  • External issue reporter N/A
  • Contributor that fixed the issue @bernhardoj $500
  • Contributor+ that helped on the issue and/or PR @cubuspl42 $500

Upwork Job: https://www.upwork.com/jobs/~01787235515a8ea167

*If applicable, the bonuses will be applied on the final payment

Extra Notes regarding payment: I disagree with this automation notice #26197 (comment). There is no bonus but there will be no penalty. There was a delay in the merge process that was outside of the contributors' control.

@alexpensify
Copy link
Contributor

Everyone has been paid here. @Gonals keep me posted if you agree with the regression test and I'll create the GH. Thanks!

@cubuspl42
Copy link
Contributor

I'm not very confident about the regression test; @mallenexpensify told me in another thread that the regression steps should be provided for all issues, and most of the time, the "QA steps" from the PR template are fine. Let me know if you agree with this.

@mallenexpensify
Copy link
Contributor

Yes @cubuspl42 , that is the standard process. Applause/QA reviews all the regression test GHs and actions on them the way they think is best (which is why it's best to err on the side of creating the TestRail GHs, cuz they can easily be closed if a regression test isn't needed). I created this one so we close

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