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-10] [HOLD for payment 2024-07-02] [$250] Message - Send button not response in mobile view and after returning to normal view #43650

Closed
2 of 6 tasks
izarutskaya opened this issue Jun 13, 2024 · 34 comments
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

@izarutskaya
Copy link

izarutskaya commented Jun 13, 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: v1.4.82-4
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Open any chat
  2. Send message by clicking on Send button
  3. Open DevTools console
  4. Switch to mobile view
  5. Type a message
  6. Click on Send Button

Expected Result:

Message sent in mobile view as in normal

Actual Result:

Send button not response. Also, after returning to normal view, Send button not response. User need to reload page

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

Bug6511866_1718276240791.mobile_view.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013bc99e56ff65d5ac
  • Upwork Job ID: 1801304586589536855
  • Last Price Increase: 2024-06-13
  • Automatic offers:
    • hoangzinh | Reviewer | 102782090
    • truph01 | Contributor | 102782092
Issue OwnerCurrent Issue Owner: @isabelastisser
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

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

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb

@isabelastisser isabelastisser added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 13, 2024
@melvin-bot melvin-bot bot changed the title Message - Send button not response in mobile view and after returning to normal view [$250] Message - Send button not response in mobile view and after returning to normal view Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

Job added to Upwork: https://www.upwork.com/jobs/~013bc99e56ff65d5ac

Copy link

melvin-bot bot commented Jun 13, 2024

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

@vaib-contrib
Copy link

vaib-contrib commented Jun 13, 2024

Proposal

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

issue is reproducible from the steps mentioned in the issue.
In browser, send message button from the chat doesn't register tap event when responsive-mode is turned-on-and-or-off from devtools, until the browser is refreshed.

What is the root cause of that problem?

For send button, we are using GestureDetector from react-native-gesture-handler lib's tap gesture, which is not necessary, and a quick search through codebase results in about 2 places where GestureDetector is used exclusively for tap interactions, while in other cases, PressableWithFeedback or PressableWithoutFeedback is used.

Places where GestureDetector is used for detecting a tap:

  1. Send Button (related to this issue)
    onMouseDown={(e) => e.preventDefault()}
    >
    <GestureDetector gesture={Tap}>
other two places... 2. IOURequestStepScan (may be affected)

{cameraPermissionStatus === RESULTS.GRANTED && device != null && (
<View style={[styles.cameraView]}>
<GestureDetector gesture={tapGesture}>

  1. MagicCodeInput (may be affected)

<View style={[styles.magicCodeInputContainer]}>
<GestureDetector gesture={tapGesture}>

## What changes do you think we should make in order to solve the problem? The straight forward solution would be to remove the `GestureDetector` wrapper, and use `TouchableWithFeedback`'s `onPress` callback instead. I have tested it locally, and it works fine.

The SendButton component would look like:

  <View
        style={styles.justifyContentEnd}
        // Keep focus on the composer when Send message is clicked.
        onMouseDown={(e) => e.preventDefault()}
    >
        <Tooltip text={translate('common.send')}>
          <PressableWithFeedback
              style={({pressed, isDisabled}) => [
                  styles.chatItemSubmitButton,
                  isDisabledProp || pressed || isDisabled ? undefined : styles.buttonSuccess,
                  isDisabledProp ? styles.cursorDisabled : undefined,
              ]}
              role={CONST.ROLE.BUTTON}
              accessibilityLabel={translate('common.send')}
              disabled={isDisabledProp}
              onPress={handleSendMessage}
          >
            ...

What alternative solutions did you explore? (Optional)

Thinking of confirming if it's an upstream issue with react-native-gesture-handler library for web, if we really need to use GestureDetector in this particular case.

Copy link

melvin-bot bot commented Jun 13, 2024

📣 @vaib-contrib! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

Copy link

melvin-bot bot commented Jun 13, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@truph01
Copy link
Contributor

truph01 commented Jun 14, 2024

Proposal

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

  • Send button not response. Also, after returning to normal view, Send button not response. User need to reload page

What is the root cause of that problem?

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

key={`${isSmallScreenWidth}`}

with:

    const {isSmallScreenWidth} = useWindowDimensions();

What alternative solutions did you explore? (Optional)

  • In the above key, we can use key={screenWidth} to make sure the button always re-renders if the layout changed.

@isabelastisser
Copy link
Contributor

Bump @hoangzinh to review the proposals above. Thanks!

@hoangzinh
Copy link
Contributor

hoangzinh commented Jun 16, 2024

Thanks for proposals, everyone.

  • @vaib-contrib replacing GestureDetector would cause a regression where the user taps on the send button but holds then drop in outside, it still triggers send message
Screen.Recording.2024-06-16.at.05.29.29.mov
  • @truph01 your solution works well but do you know why it doesn't happen in other places (I.e video player progress bar...)

@truph01
Copy link
Contributor

truph01 commented Jun 16, 2024

@hoangzinh The video player progress uses Gesture.Pan(), not Gesture.Tap() so there is no issue with it.

@hoangzinh
Copy link
Contributor

@truph01 how about MagicCode?

const tapGesture = Gesture.Tap()

@truph01
Copy link
Contributor

truph01 commented Jun 18, 2024

@hoangzinh I see that the MagicCodeInput always mounts again one we change from large screen to small screen, so there is no similar bug. You can try to add the below logic to that file:

    useEffect(()=>{
        console.log("mounted")
    }, [])

@truph01
Copy link
Contributor

truph01 commented Jun 18, 2024

@hoangzinh As you can see in this logic, https://github.com/software-mansion/react-native-gesture-handler/blob/0b983ed9dd6c7e11d3b6906a85faa535346a16e0/src/handlers/gestures/GestureDetector/index.tsx#L154-L160, the attachHandler function (that will make the gesture works properly) is only called one time when the component is mounted.

That is why in my solution, I added the key prop, and every time a component's key changes React will create a new component instance rather than update the current one.

@hoangzinh
Copy link
Contributor

Looks good, can you add above into your proposal so internal engineer can review it as well? Thanks

@truph01
Copy link
Contributor

truph01 commented Jun 18, 2024

@hoangzinh I updated proposal

@hoangzinh
Copy link
Contributor

@truph01's proposal #43650 (comment) looks good to me

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 18, 2024

Triggered auto assignment to @luacmartins, 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 Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

📣 @hoangzinh 🎉 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 melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 19, 2024
@truph01
Copy link
Contributor

truph01 commented Jun 19, 2024

@hoangzinh PR #43976 can be reviewed

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 25, 2024
@melvin-bot melvin-bot bot changed the title [$250] Message - Send button not response in mobile view and after returning to normal view [HOLD for payment 2024-07-02] [$250] Message - Send button not response in mobile view and after returning to normal view Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.1-19 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 2024-07-02. 🎊

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

Copy link

melvin-bot bot commented Jun 25, 2024

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:

  • [@hoangzinh] The PR that introduced the bug has been identified. Link to the PR:
  • [@hoangzinh] 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:
  • [@hoangzinh] 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:
  • [@hoangzinh] Determine if we should create a regression test for this bug.
  • [@hoangzinh] 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.
  • [@isabelastisser] 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 Weekly KSv2 and removed Weekly KSv2 Daily KSv2 labels Jul 2, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-02] [$250] Message - Send button not response in mobile view and after returning to normal view [HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [$250] Message - Send button not response in mobile view and after returning to normal view Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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

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

Copy link

melvin-bot bot commented Jul 3, 2024

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:

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

@isabelastisser
Copy link
Contributor

Bump @hoangzinh to complete the checklist above before payment. Thanks!

@hoangzinh
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: I think it's not a bug but a new scenario that we haven't covered yet. Therefore, there is no offending PR here.
  • 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: N/A
  • Determine if we should create a regression test for this bug: ⛔ It's an edge case UI improvement.

@isabelastisser isabelastisser added Daily KSv2 and removed Weekly KSv2 labels Jul 10, 2024
@isabelastisser
Copy link
Contributor

@hoangzinh $250 automatic offer (Reviewer), please accept the offer in Upwork, and I will process the payment. Thanks!

@truph01 automatic offer (Contributor). The payment is processed in Upwork.

@isabelastisser
Copy link
Contributor

all set!

@hoangzinh
Copy link
Contributor

Accepted. Thanks @isabelastisser

@hoangzinh
Copy link
Contributor

Hi @isabelastisser I haven't received the payment yet. Can you checkout the offer link here https://www.upwork.com/nx/wm/offer/102782090? Thank you.

@isabelastisser
Copy link
Contributor

Hey @hoangzinh, the payment has been processed. Can you please confirm? Thanks!

@hoangzinh
Copy link
Contributor

Received. Thanks @isabelastisser

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
No open projects
Archived in project
Development

No branches or pull requests

6 participants