-
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 for payment 2024-07-24] [$250] Expense - Console error shows up when opening description that contains code block #43750
Comments
Triggered auto assignment to @kadiealexander ( |
@kadiealexander 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 #wave-collect - Release 1 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Console error when open a money request description page that contains code block/fence. What is the root cause of that problem?The code block that we receive from the BE contains a If it's different, then we get the error. As shown in the video, if we have the markdown as
the processed input will be
Why the first
Notice that the children already lost the first
We add the It's because of a markdown to HTML bug(?) in ExpensiMark.
is parsed to
The current regex for code fence is If matched, the parser will convert it to
Notice that the first group matches the first line break, that's why the first line break is lost. What changes do you think we should make in order to solve the problem?The simplest and safest way to solve this is to replace every kind of line break (CONST.REGEX.LINE_BREAK) with
But if we want to fix the root cause, then we need to: Update the codefence regex to include the first line break to the second group. -addChildrenWithStyle(`\n${content}`, 'pre');
+addChildrenWithStyle(content, 'pre'); What alternative solutions did you explore? (Optional)We can apply the fix in react-native-live-markdown. In
Then replace all usages of |
Job added to Upwork: https://www.upwork.com/jobs/~014b73c4727a3648d0 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
Contributor details Hi. I have solved the problem by converting \r\n to unicode. Just one line of code needed to add output.mp4 |
📣 @nurhesen! 📣
|
Contributor details Hi. I have solved the problem by converting \r\n to unicode. Just one line of code needed to add output.mp4 |
|
Contributor details Hi. I have solved the problem by converting \r\n to unicode. Just one line of code needed to add output.mp4 |
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Console error shows up when opening description that contains code block What is the root cause of that problem?react-native-live-markdown doesn't process \r\n correctly What changes do you think we should make in order to solve the problem?Converting \r\n to unicode fixes the problem. Just adding one line of code needed. Here is the video proof that converting \r\n to unicode solves the problem. output.mp4What alternative solutions did you explore? (Optional)Alternatively single "\n"s can be converted in the view to "\r\n" in order to keep the consistency |
@bernhardoj Thanks for the proposal. Your RCA makes sense. But the first newline being consumed is actually expected because the syntax for the code block must have a new line:
This is not a valid code block
This is a valid code block and the content is In the returned Can we just replace all |
@nurhesen Thanks for the proposal. Your RCA is not clear. Can you please elaborate? |
Ah, I see. I remember
is a valid code block. I didn't realize it's changed now. (or maybe that's always the case?) Updated my proposal to replace the new line in react-native-live-markdown. |
Hi! I'm Bartosz from SWM I'll try to review existing proposals / triage the bug later today 👀 |
@bernhardoj Thanks for the update! That looks good to me. 🎀 👀 🎀 C+ reviewed |
The react-native-live-markdown PR is ready: Expensify/react-native-live-markdown#413 |
App PR is ready cc: @s77rt |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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-24. 🎊 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:
|
I'll request in ND once payment is due. |
|
@bernhardoj I see you've accepted the Upwork contract, would you prefer to be paid via NewDot? |
Yes please, I have ended the UW contract and requested in ND instead. |
Can I get a payment summary for ND payment approval? |
Payouts due:
|
$250 approved for @bernhardoj |
$250 approved for @s77rt |
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: 1.4.83-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
Action Performed:
Expected Result:
Console error will not show up when opening description that contains code block
Actual Result:
Console error shows up when opening description that contains code block.
Typing inside the code block creates more console errors
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6512409_1718310569210.20240614_042601.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @kadiealexanderThe text was updated successfully, but these errors were encountered: