-
Notifications
You must be signed in to change notification settings - Fork 3k
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-04-15] [Pay meow][$500] Typed messages disappear for a moment when typing in the compose box #38966
Comments
Triggered auto assignment to @anmurali ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The text disappears when we type into the composer immediately after navigating to it. What is the root cause of that problem?In SilentCommentUpdater, we have a logic to update the composer text with the draft. App/src/pages/home/report/ReportActionCompose/SilentCommentUpdater/index.tsx Lines 19 to 32 in d8361ee
After the chat switch improvement PR, we delay the update comment call. So, when you open a chat then type immediately, it will be replaced with the above effect logic. What changes do you think we should make in order to solve the problem?Remove the What alternative solutions did you explore? (Optional)The purpose of that effect logic is to replace any emoji text in Spanish when we switch our language to Spanish (for example, if we type :rosa: then switch to Spanish, we want to replace it with 🌹, just like Slack did). It was introduced in this PR and specifically added for the small screens because, for large screens, the App/src/pages/home/report/ReportActionCompose/SilentCommentUpdater/index.tsx Lines 34 to 46 in d8361ee
If we don't want that feature anymore, we can remove it, but I'm sure we want to keep it, so the other alternative is to replace the emoji text in the So, first, we remove this effect code: App/src/pages/home/report/ReportActionCompose/SilentCommentUpdater/index.tsx Lines 19 to 32 in d8361ee
Then do the emoji replacement in here: App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 265 to 270 in d8361ee
const [value, setValue] = useState(() => {
if (draftComment) {
emojisPresentBefore.current = EmojiUtils.extractEmojis(draftComment);
// Replace any emoji text with emoji code to replace any unprocessed emoji text because of the locale difference.
const {text: newComment, emojis} = EmojiUtils.replaceAndExtractEmojis(draftComment, preferredSkinTone, preferredLocale);
if (emojis.length) {
// If there is a text replaced to emoji, add it to the frequently used emojis, save the new draft, and returns it.
const newEmojis = EmojiUtils.getAddedEmojis(emojis, emojisPresentBefore.current);
if (newEmojis.length) {
insertedEmojisRef.current = newEmojis;
debouncedUpdateFrequentlyUsedEmojis();
}
const newCommentConverted = convertToLTRForComposer(newComment);
emojisPresentBefore.current = emojis;
Report.saveReportComment(reportID, newCommentConverted || '');
return newCommentConverted;
}
}
return draftComment;
}); We eliminate lots of code from calling App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 448 to 450 in d8361ee
|
Checking on in the issue @bernhardoj linked above |
ProposalPlease re-state the problem that we are trying to solve in this issue.On Desktop app, typing as soon as opening a report makes comments on compose box flick. What is the root cause of that problem?
App/src/pages/home/report/ReportActionCompose/SilentCommentUpdater/index.tsx Lines 8 to 12 in 0509f8d
Let me explain detail what's happening. On every typing motion(key down, key up), acts and it acts many times. Every comment is shown but empty value too. So to keep this from acting useless, there are conditions. App/src/pages/home/report/ReportActionCompose/SilentCommentUpdater/index.tsx Lines 34 to 46 in 0509f8d
When 2024-03-27.11.31.11.movLet me explain how
First, any
If typed value, saved comment and previous comment aren't same then the comment on the compose box is changed.
If any of three is different the compose box is changed too. It means typing isn't finished.
When typing is finished then all three is same.
Let me explain how empty value makes flickering. Every comment, even empty value : empty -> comment : empty -> prevCommentProp: empty So empty value is saved on compose box too. All three value are same so to stop synchronizing. But after empty value is finished, the same typed previous value is saved into Onyx again. So it is synchronized on the compose box too. If empty value is stoped to be checked then flickering is stoped too. What changes do you think we should make in order to solve the problem?If it is electron app, then we should check the import getPlatform from '@libs/getPlatform';
...
useEffect(() => {
// Value state does not have the same value as comment props when the comment gets changed from another tab.
// In this case, we should synchronize the value between tabs.
const shouldSyncComment = prevCommentProp !== comment && value !== comment;
if(!value && getPlatform() === 'desktop') return;
// As the report IDs change, make sure to update the composer comment as we need to make sure
// we do not show incorrect data in there (ie. draft of message from other report).
if (preferredLocale === prevPreferredLocale && reportID === prevReportId && !shouldSyncComment) {
return;
}
updateComment(comment ?? ''); What alternative solutions did you explore? (Optional)N/A |
Waiting for an update here |
Asked in Slack the PR authors too https://expensify.slack.com/archives/C03UK30EA1Z/p1711752149732359 |
Reported again this morn https://expensify.slack.com/archives/C049HHMV9SM/p1711975160869279 |
Hey guys, I can't seem to repro this issue. See the attached video, is there something I am missing in the repro steps? As mentioned in PR description, I tested it on Desktop. issue-repro.mp4Apart from this, @bernhardoj's proposal here looks good in terms of removing the delay to call |
We can definitely add the check. There won't be any issue with adding the check. I think you need to type it faster. I also sometimes can't reproduce the issue when I was milliseconds late. Screen.Recording.2024-04-02.at.16.34.30.mov |
Job added to Upwork: https://www.upwork.com/jobs/~0167dbea954a52c8eb |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
We have used @bernhardoj solution so we should pay them $125 for help |
If we used their solution/code, we should compensate $250. 50% is our standard amount. I updated the internal SO recently.
I'll take over as BZ to see this one through since I've been reporting and monitoring these issues. |
Sounds good to me |
@bernhardoj can you please accept the job and reply here once you have? |
@mallenexpensify accepted |
Contributor: @bernhardoj paid $250 via Upwork |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 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-04-15. 🎊 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:
|
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.56-2
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
Expensify/Expensify Issue URL:
Issue reported by: @mallenexpensify
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1711132608014349
Notes
There are two versions of this bug that have the same outcome, text disappears. As viewed in the video below, this can occur immediately after switching to a new chat. This has also starting happening more this week with random, one-off characters disappearing or showing out of order.
Action Performed:
Expected Result:
The text to show in the box
Actual Result:
Text gets lost after typing a handful of characters.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.2898.mp4
2024-03-22_11-32-40.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: