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-09-18] [$1000] Android App - The resizing icon doesn't disappear immediately after sending the message #25975

Closed
1 of 6 tasks
izarutskaya opened this issue Aug 25, 2023 · 28 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

@izarutskaya
Copy link

izarutskaya commented Aug 25, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

1- Open a chat
2- write multi lines message
3- Click on the send icon

Expected Result:

The resizing icon should disappear immediately after sending the message

Actual Result:

The resizing icon doesn't disappear immediately after sending the message

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: v1.3.57-5

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

Screen_Recording_20230815-214619.mp4
Screen.Recording.20230825.231813.New.Expensify.mp4

Expensify/Expensify Issue URL:

Issue reported by: @mejed-alkoutaini

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692125347899059

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0183904df145af1e22
  • Upwork Job ID: 1696574863441436672
  • Last Price Increase: 2023-09-05
  • Automatic offers:
    • fedirjh | Reviewer | 26545129
    • mejed-alkoutaini | Reporter | 26545130
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@melvin-bot
Copy link

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

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Aug 29, 2023
@zanyrenney
Copy link
Contributor

Triaged!

@melvin-bot melvin-bot bot changed the title Android App - The resizing icon doesn't disappear immediately after sending the message [$1000] Android App - The resizing icon doesn't disappear immediately after sending the message Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0183904df145af1e22

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

melvin-bot bot commented Aug 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@zanyrenney
Copy link
Contributor

Took action, this is not overdue.

@studentofcoding
Copy link
Contributor

Proposal

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

Android App - The resizing icon doesn't disappear immediately after sending the message

What is the root cause of that problem?

The root cause of the delayed display of the When the message is sent likely due to the asynchronous nature of the JavaScript event loop and the rendering process on Android devices, we can use state to check whether the form is submitted or not, and immediately hide the expand icon

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

In the AttachmentPickerWithMenuItems component in AttachmentPickerWithMenuItems.js, you can add a new prop shouldShowExpandIcon to control the visibility of the Expand Icon. Then, you can pass this prop from the parent component ReportActionCompose to AttachmentPickerWithMenuItems and update its value when the form is submitted.

  • On ReportActionCompose.js include the new state of shouldShowExpandIcon and set it false on submitForm function :
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';

// ...

function ReportActionCompose({
    // ...
    onSubmit,
}) {
    // ...

    const [shouldShowExpandIcon, setShouldShowExpandIcon] = useState(true);

    const submitForm = useCallback(() => {
        // Hide the Expand Icon immediately when the form is submitted
        setShouldShowExpandIcon(false);

        // Call the onSubmit function to submit the form
        onSubmit();
        // Reset the state        
        setShouldShowExpandIcon(true);
    }, [onSubmit]);

    // ...

    return (
        // ...
        <AttachmentPickerWithMenuItems
            // ...
            shouldShowExpandIcon={shouldShowExpandIcon}
        />
        // ...
    );
}

// ...
import React, { useMemo } from 'react';

// ...

function AttachmentPickerWithMenuItems({
    // ...
    shouldShowExpandIcon,
}) {
    // ...

    return (
        // ...
        {!isComposerFullSize && isFullComposerAvailable && shouldShowExpandIcon && (
            <Tooltip text={translate('reportActionCompose.expand')}>
                <PressableWithFeedback
                    onPress={(e) => {
                        e.preventDefault();
                        updateShouldShowSuggestionMenuToFalse();
                        Report.setIsComposerFullSize(reportID, true);
                    }}
                    // Keep focus on the composer when Expand button is clicked.
                    onMouseDown={(e) => e.preventDefault()}
                    style={styles.composerSizeButton}
                    disabled={isBlockedFromConcierge || disabled}
                    accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
                    accessibilityLabel={translate('reportActionCompose.expand')}
                >
                    <Icon src={Expensicons.Expand} />
                </PressableWithFeedback>
            </Tooltip>
        )}
        // ...
    );
}

// ...

Result

expand-icon-auto-hide-onsubmit.mp4

cc: @zanyrenney @fedirjh

@HezekielT
Copy link
Contributor

HezekielT commented Sep 1, 2023

Proposal

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

The resizing icon doesn't disappear immediately after sending the message.

What is root cause of that problem?

In SendButton.js, when the user presses the send button

const Tap = Gesture.Tap()
.enabled()
.onEnd(() => {
'worklet';
const viewTag = animatedRef();
const viewName = 'RCTMultilineTextInputView';
const updates = {text: ''};
// We are setting the isCommentEmpty flag to true so the status of it will be in sync of the native text input state
runOnJS(setIsCommentEmpty)(true);
updatePropsPaperWorklet(viewTag, viewName, updates); // clears native text input on the UI thread
runOnJS(submitForm)();
});

it seems first we clear the text input on the UI thread and then run submitForm which in turn sets isComposerFullSize to false.

if (isComposerFullSize) {
Report.setIsComposerFullSize(reportID, false);
}
setIsFullComposerAvailable(false);

So clearly there is a time window between these two(clearing the input on the UI and resetting isComposerFullSize) which is why there is a delay. This is the root cause.

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

We need to execute the logic that resets isComposerFullSize and isFullComposerAvailable to false at the same time we clear the text input. We can do that by adding

runOnJs(resetComposer)()

right before this line here

updatePropsPaperWorklet(viewTag, viewName, updates); // clears native text input on the UI thread

where resetComposer is

() => {
    if (isComposerFullSize) {
            Report.setIsComposerFullSize(reportID, false);
    }
    setIsFullComposerAvailable(false);
}
    

and will be passed as a prop from ReportActionCompose.js to SendButton

What alternative solutions did you explore? (Optional)

Since we already have isCommentEmpty flag that will be set to true in SendButton.js we can pass it to AttachmentPickerWithMenuItem as a prop from ReportActionCompose.js and use it in required places such as this one.

{!isComposerFullSize && isFullComposerAvailable && (

{!isComposerFullSize && isFullComposerAvailable && !isCommentEmpty && (

Result

@melvin-bot melvin-bot bot added the Overdue label Sep 1, 2023
@zanyrenney
Copy link
Contributor

@fedirjh what do you think of the proposal above?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 1, 2023
@zanyrenney
Copy link
Contributor

bump @fedirjh please can you take a look?

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

melvin-bot bot commented Sep 5, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@fedirjh
Copy link
Contributor

fedirjh commented Sep 5, 2023

@studentofcoding Thanks for the proposal, Your root cause analysis is not accurate.


This proposal from @HezekielT makes sense to me, It fixes the root cause which was introduced during the refactoring of ReportActionCompose. I am leaning toward the alternative solution as it's the most straightforward fix.

🎀 👀 🎀 C+ reviewed

@fedirjh fedirjh mentioned this issue Sep 5, 2023
57 tasks
@fedirjh

This comment was marked as resolved.

@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

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

@MariaHCD
Copy link
Contributor

MariaHCD commented Sep 7, 2023

The alternative solution in @HezekielT's proposal makes sense to me. We still have a merge freeze till Monday so we can definitely the PR up and in a mergeable state but we won't merge until next week.

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

melvin-bot bot commented Sep 7, 2023

📣 @fedirjh 🎉 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 7, 2023

📣 @HezekielT You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

📣 @mejed-alkoutaini 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@mejed-alkoutaini
Copy link

@izarutskaya Hey I think the offer should be 250$ instead of 50$ since this was reported before the price change

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

🎯 ⚡️ Woah @fedirjh / @HezekielT, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @HezekielT got assigned: 2023-09-07 12:56:48 Z
  • when the PR got merged: 2023-09-11 02:34:50 UTC

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 Sep 11, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Android App - The resizing icon doesn't disappear immediately after sending the message [HOLD for payment 2023-09-18] [$1000] Android App - The resizing icon doesn't disappear immediately after sending the message Sep 11, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

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 Sep 11, 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:

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

@fedirjh
Copy link
Contributor

fedirjh commented Sep 12, 2023

BugZero Checklist:

  • Link to the PR: Performance: chat input #25758
  • Link to comment: Performance: chat input #25758 (comment)
  • Link to discussion: N/A This could have been caught during testing. Given that the refactor touched multiple files, it's common that some bugs are missed, in this case, a regression test could help catch these bugs.
  • Determine if we should create a regression test for this bug: ✅

Regression Test Proposal

  1. Open any chat.
  2. Start typing multiline messages until the expand icon appears.
  3. Click on the send button.
  4. Verify that the expand icon disappears immediately.
  • Do we agree 👍 or 👎

@zanyrenney
Copy link
Contributor

zanyrenney commented Sep 18, 2023

Payment summary

@fedirjh requires payment offer (Reviewer) - this job is eligible for a 50% #urgency bonus - PAID $1500 due to urgency bonus.
@HezekielT requires payment - this job is eligible for a 50% #urgency bonus - PAID $1500 due to urgency bonus.
@mejed-alkoutaini requires payment offer (Reporter) - PAID $250 as before price change.

@zanyrenney
Copy link
Contributor

All payments complete, closing!

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
None yet
Development

No branches or pull requests

7 participants