You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-10-16] Chat - Expand button disappear after clicking even when composer has error #27779
Paste the message that has over 15,000 characters (To make the error shows).
Now the composer will have red border and expand button is visible, click on the Send button.
Notice that now the Composer doesn’t have Expand button.
Expected Result:
Expand button should be visible after clicking Send button
Actual Result:
Expand button disappear after clicking even when composer has error
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.71.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
Please re-state the problem that we are trying to solve in this issue.
Composer: The expand button disappears after you click on the send button
What is the root cause of that problem?
Currently, clicking on the send button will call the resetFullComposerSize - which will set the isFullComposerAvailable state to false regardless the isSendDisabled is true or not. That leads to the bug: When the composer has > 15.000 characters, clicking on <SendButton /> will make the expand button disappear. This is the RCA that directly lead to this bug.
// 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);
runOnJS(resetFullComposerSize)();
updatePropsPaperWorklet(viewTag,viewName,updates);// clears native text input on the UI thread
runOnJS(submitForm)();
});
In above, clicking on <SendButton /> not only trigger submitForm, but also setIsCommentEmpty, resetFullComposerSize and updatePropsPaperWorklet
What changes do you think we should make in order to solve the problem?
The action pressing on ENTER key or clicking on SendButton has the same role when typing a message but in our app, we handle these two actions separately
So we should create a function that handles both clicking send button and pressing ENTER, like below:
const handleClickingOnSendOrPressingEnter = (isSendDisable) => {
if (isSendDisable) {
return;
} else {
'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);
runOnJS(resetFullComposerSize)();
updatePropsPaperWorklet(viewTag, viewName, updates); // clears native text input on the UI thread
runOnJS(submitForm)();
}
};
If isSendDisable is true, stop the function so that the bug is fixed and the logic when clicking SendButton or pressing ENTER is clearer
If you could update your proposal so that send button won't be disabled during chat loading, but be disabled only after clicking on it
Then update the handleClickingOnSendOrPressingEnter in my proposal to:
const handleClickingOnSendOrPressingEnter = (isSendDisable, isReportReadyForDisplay) => {
if (isSendDisable || !isReportReadyForDisplay) {
return;
} else {
// Hanle submit and clean up logic
}
};
The above solution will make sure the Send button won`t be disabled during the chat loading, it still displays as clickable, the composer border still displays with a green border, but clicking on send button will not trigger the submit and clean up logic
What alternative solutions did you explore? (Optional)
changed the title [-]Chat - Clicking on Send button make the error disappear[/-][+][$500] Chat - Clicking on Send button make the error disappear[/+]on Sep 19, 2023
However, we're using GestureDetector's gesture to handle the click on Send button, so even the send button is disabled, it still perform the gesture and in our Tap gesture which caused this issue:
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-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-10-16. 🎊
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:
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:
[@robertKozik] The PR that introduced the bug has been identified. Link to the PR:
[@robertKozik] 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:
[@robertKozik] 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:
[@robertKozik] Determine if we should create a regression test for this bug.
[@robertKozik] 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.
[@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
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:
[@robertKozik] 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
[@robertKozik] Determine if we should create a regression test for this bug. I don't think we need new test here
[@robertKozik] 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. N/A
Hi @DylanDylann - I actually queried this with another GH (same situation, delay in C+) and was told that bonuses only apply if the Expensify Engineer is delayed. Sorry!
Activity
DylanDylann commentedon Sep 19, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
resetFullComposerSize- which will set theisFullComposerAvailablestate tofalseregardless theisSendDisabledis true or not. That leads to the bug: When the composer has > 15.000 characters, clicking on<SendButton />will make the expand button disappear. This is the RCA that directly lead to this bug.isSendDisableisfalsestill triggers a few functions: For example:App/src/pages/home/report/ReportActionCompose/SendButton.js
Lines 36 to 49 in 436b75d
<SendButton />not only triggersubmitForm, but alsosetIsCommentEmpty,resetFullComposerSizeandupdatePropsPaperWorkletWhat changes do you think we should make in order to solve the problem?
App/src/pages/home/report/ReportActionCompose/SendButton.js
Lines 36 to 49 in 436b75d
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js
Lines 281 to 285 in ae30313
isSendDisableis true, stop the function so that the bug is fixed and the logic when clicking SendButton or pressing ENTER is clearerApp/src/pages/home/ReportScreen.js
Lines 428 to 447 in cfad43f
handleClickingOnSendOrPressingEnterin my proposal to:What alternative solutions did you explore? (Optional)
[-]Chat - Clicking on Send button make the error disappear[/-][+][$500] Chat - Clicking on Send button make the error disappear[/+]melvin-bot commentedon Sep 19, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01e5b7548a5c671a9e
melvin-bot commentedon Sep 19, 2023
Triggered auto assignment to @jliexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 19, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Sep 19, 2023
Triggered auto assignment to @sakluger (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.melvin-bot commentedon Sep 19, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @robertKozik (
External)kbecciv commentedon Sep 19, 2023
Proposal by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694937956481939
Proposal
Please re-state the problem that we are trying to solve in this issue.
Composer: Clicking on Send button make the error disappear while actually it should do nothing.
What is the root cause of that problem?
We're setting disable style for our Pressable inside SendButton here.
App/src/pages/home/report/ReportActionCompose/SendButton.js
Lines 57 to 64 in c77814f
However, we're using
GestureDetector's gesture to handle the click on Send button, so even the send button is disabled, it still perform the gesture and in our Tap gesture which caused this issue:App/src/pages/home/report/ReportActionCompose/SendButton.js
Lines 36 to 49 in c77814f
What changes do you think we should make in order to solve the problem?
Solution 1:
We should disable the Tap gesture if
isDisabledPropis true:Solution 2:
Add an early return when
isDisabledPropis true insideonEndfunction:What alternative solutions did you explore? (Optional)
N/A
36 remaining items
melvin-bot commentedon Oct 9, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 9, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-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-10-16. 🎊
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.
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:
melvin-bot commentedon Oct 9, 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:
robertKozik commentedon Oct 10, 2023
DylanDylann commentedon Oct 12, 2023
@aldo-expensify Please help check #27779 (comment) when you have a chance
jliexpensify commentedon Oct 18, 2023
Hi @DylanDylann - I actually queried this with another GH (same situation, delay in C+) and was told that bonuses only apply if the Expensify Engineer is delayed. Sorry!
jliexpensify commentedon Oct 18, 2023
Payment Summary:
Upwork job
DylanDylann commentedon Oct 18, 2023
Yeah thanks @jliexpensify
jliexpensify commentedon Oct 18, 2023
All paid and job closed!