-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 /react-native-live-markdown#366] [$250] IOU - one character descriptions are not saved #40799
Comments
Triggered auto assignment to @sakluger ( |
@sakluger FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
We think that this bug might be related to #vip-vsp |
Job added to Upwork: https://www.upwork.com/jobs/~0160ab7a88d7f75bcd |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
I'm adding this to the Wave-Collect project since it's related to submitting expenses. |
I couldn't reproduce this issue even on |
I couldn't reproduce this issue either. |
Same here, unable to reproduce locally, or on |
ProposalPlease re-state the problem that we are trying to solve in this issue.IOU - one character descriptions are not saved What is the root cause of that problem?the bug is from https://github.com/Expensify/react-native-live-markdown When the system launches with an input method that has autocomplete, it triggers the onCompositionStart event, setting compositionRef.current to true. This causes handleOnChangeText to return early. Refer to: #40799 (comment) The same issue occurs when you input one character and then select a word from the keyboard's autocomplete suggestions—the entire word does not update afterwards. 2024-04-26.21.13.07.movWhat changes do you think we should make in order to solve the problem?I suggest removing these two lines in https://github.com/Expensify/react-native-live-markdown const nativeEvent = e.nativeEvent; // move this line from below to here
if (compositionRef.current
&& e.nativeEvent.inputType === 'insertCompositionText' // add this condition not effect the PR https://github.com/Expensify/react-native-live-markdown/pull/210
) {
updateTextColor(divRef.current, e.target.innerText);
compositionRef.current = false;
return;
} What alternative solutions did you explore? (Optional)I think this solution is not very elegant, but it indeed solves two problems simultaneously.
let text = '';
switch (nativeEvent.inputType) {
case 'historyUndo':
text = undo(divRef.current);
break;
case 'historyRedo':
text = redo(divRef.current);
break;
default:
text = parseText(divRef.current, e.target.innerText, processedMarkdownStyle).text;
} Then, the PR Expensify/react-native-live-markdown#210 used a temporary solution, and this time another short-term solution is added. This will become difficult to modify later and turn into technical debt if not redesign. |
It seems like some people are having trouble reproducing the issue. @charles-liang were you able to reproduce the behavior? If so, did you do anything that wasn't outlined in the reproduction steps above? |
In my case, entering a single character and then clicking save works fine. However, when entering two characters, setValue is not triggered, and onChangeText only receives the value of the first character, but onBlur can capture the value of two characters. Then, clicking save will result in the loss of the second value. I believe the problem is the same, that sometimes setValue is not triggered during the system keyboard's autocomplete, causing the value not to be updated. |
Thanks for the proposal and reproduction steps @charles-liang. I was able to reproduce the issue with single character. Can you please add more details in your RCA? Why does the setValue function only receives part of the input?
|
Finally, I turned off isMarkdownEnabled and set it to false, which fixed the issue App/src/pages/iou/request/step/IOURequestStepDescription.tsx Lines 164 to 184 in 34434a5
If isMarkdownEnabled must be set to true, I found the root cause in react-native-live-markdown. In some cases, when compositionRef.current is true, the function returns early without output handleOnChangeText3, and it does not fire the onChangeText and onChange events |
Great finding @charles-liang In that case I am pretty sure, the issue lies on Composer as well. So, setting |
Proposal |
Thanks for the update @charles-liang. Those changes were introduced by Expensify/react-native-live-markdown#210 PR to solve #36942 issue. Can you please verify that the change you are suggesting do not cause any regression? |
@sobitneupane Received. I have revised the proposal and proposed three solutions at different levels. |
Proposal |
@charles-liang Proposal is not updated. Also, please consider #40799 (comment) in your solution. |
Triggered auto assignment to @twisterdotcom ( |
@twisterdotcom assigning you while I'm OOO through May 31. The latest is that the PR is being worked on here: Expensify/react-native-live-markdown#343. |
@sakluger, @twisterdotcom, @charles-liang, @blimpich, @sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick! |
The PR is being reviewed. |
@sakluger, @twisterdotcom, @charles-liang, @blimpich, @sobitneupane 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
@charles-liang what is the status of the PR? Still coming along? |
@blimpich I submit the pr for Expensify/react-native-live-markdown#343 and waiting approval |
@sobitneupane any update since your last comment? Have you had a chance to review the PR? |
I'm back - thanks @twisterdotcom for watching, I'll unassign you now. @sobitneupane what is the latest? |
Hi! I have a question regarding this issue - is this only happening on mWeb? |
@BartoszGrajdek I could reproduce it only in mWeb/Chrome |
Good, I know that your problems are likely related to the composition event types. We're thinking about disabling the composition handling on mWeb due to multiple bugs that are related to it. Can you check if the bug is still appearing using this version of the library? |
I am pretty sure it should solve the issue. I will let you know after testing it. cc: @charles-liang |
@sobitneupane Thank you very much for your review. If you need me to follow up, please let me know. |
I tested Expensify/react-native-live-markdown#366 PR and the issue will not be reproducible with the changes introduced by the PR. |
@sakluger We can hold this issue for now and retest it after Expensify/react-native-live-markdown#366 gets merged and the version of react-native-live-markdown gets bumped in the app. |
Added the hold, but leaving as daily since that PR was merged and we just need to wait for the app version to be bumped. |
@sobitneupane are we good to retest yet? Or do we still need to wait for the version of RNLM to be bumped? |
@sakluger, @charles-liang, @blimpich, @sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick! |
I can no longer reproduce the issue in staging. |
Nice! I will go ahead and close. I don't think any payment is due here, but please bring up in Slack if you disagree. |
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.64-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Issue found when executing PR #40176
Action Performed:
Expected Result:
One character letter should be saved
Expected Result:
One character letter is not saved as a Description but works fine with one digit numbers and 2 character letters. In order to save the description user has to insert whitespace by tapping on space after the character and hit save
Actual Result:
Unknown
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6458722_1713873714439.Screen_Recording_20240423_145724_Chrome.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @sobitneupaneThe text was updated successfully, but these errors were encountered: