-
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
[$2000] IOU Request message changes & removes some characters after sending. #15026
Comments
Triggered auto assignment to @lschurr ( |
Bug0 Triage Checklist (Main S/O)
|
I was able to reproduce. Adding Eng for another set of eyes. Should this be internal or external? |
Triggered auto assignment to @tgolen ( |
Looks like a legit bug. |
Job added to Upwork: https://www.upwork.com/jobs/~0123dd9e5d8f2edaa2 |
ProposalPlease re-state the problem that we are trying to solve in this issue.IOU What is the root cause of that problem?The root cause of this problem is that
For example, if we request funds with a message "Tokyo <> Mexico", then
What changes do you think we should make in order to solve the problem?Note that, in the chat, we can send normal messages contain HTML characters and it works well, like sending message
This is because we call So, to fix this issue, we can also use Line 289 in d42e443
and Line 333 in d42e443
to const comment = Str.safeEscape(this.state.comment.trim()); Then we can fix this issue for This solution needs backend to fix historical data if necessary. What alternative solutions did you explore? (Optional)N/A ResultWorking well after the fix 15026.mp4 |
Current assignee @lschurr is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Current assignee @tgolen is eligible for the External assigner, not assigning anyone new. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Whenever we enter some text like What is the root cause of that problem?Here is the thing, from input iou message we are striping html tag during save etc. So it will never show html tag pair like But we can show characters that exist within What changes do you think we should make in order to solve the problem?We are displaying reminder of IOU message at line 80 as shown below: App/src/components/ReportActionItem/IOUQuote.js Lines 79 to 80 in 14ebe26
So we can show chars that was not stripped during save by changing the code at line 80 as shown below. i.e. use {/* Get remainder of IOU message */}
- {Str.htmlDecode(fragment.text.substring(fragment.text.indexOf(' ')))}
+ {Str.htmlDecode(fragment.html.substring(fragment.text.indexOf(' ')))} Note: It will not show any html tag pair like |
This issue is also reproducible if you send a message that is 10000 chars or longer. |
I am not sure if we wanna change something here. |
@thesahindia We should apply the same fix there. |
Yes, I agree. I think we can decode message text here App/src/components/ReportTransaction.js Line 79 in e31cb53
|
I want to be very cautious here with this change, just because of the XSS nature of this. Please be sure to include tests on the PR which show that XSS cannot happen. 🟢 for the proposal 👍 @Julesssss do you happen to have any context about why this has always displayed the 6870e69#diff-a3328ec5d9b5b7526e668f601b713a91821426315993b3e93a31b91f0ec0e38dR18 |
cc @Julesssss @marcaaron @AndrewGable @luacmartins for some additional thoughts on this validation. |
I think that we should be consistent with our validation whether inputs are controlled by Form or not. It seems like we discussed and decided to check for invalid characters and display an error message in Form, so I think that we should do that same here. |
Just brought the discussion to a Slack thread |
Just posting because while fixing the profile names here, even though we know that messages will be probably be fixed here with the linked PR, the notifications seem to have the same issue so just making sure we test them as well to decide if this can be closed or not. |
PR #15578 is in production but the issue still exists if we use HTML characters like Screen.Recording.2023-03-06.at.11.33.37.PM.movI think, for IOU message, we should fix this from frontend by escaping it before sending and decoding the message text from backend. Also see discussions in slack |
So... are we thinking of just closing out this issue and deleting the PR then? It sounds like everything is covered? |
@tgolen I think the notifications are still not fixed. |
Though I would wait until the other PR gets merged to see if all cases reported here are fixed. I think |
@tgolen, @lschurr, @thesahindia, @eh2077 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@tgolen, @lschurr, @thesahindia, @eh2077 Huh... This is 4 days overdue. Who can take care of this? |
@tgolen, @lschurr, @thesahindia, @eh2077 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it! |
@tgolen - are we ready to close this one? |
@tgolen, @lschurr, @thesahindia, @eh2077 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
This has been fixed already by other PRs, but I wonder if this qualifies for reporting bonus. I think this one is the oldest of all of them so maybe we need to pay the bonus for this one and not here. |
The other PR fix messages that are sent to PS: It's important to use |
We used ReportUtils.getParsedComment which uses |
Alright, so just a reporting bonus on this GH for @priyeshshah11, correct? |
I created a new job since the old one expired. Can you apply to this job @priyeshshah11? https://www.upwork.com/jobs/~01748dd7f27e5bdfae |
@lschurr Applied |
@lschurr, I think according to the C+ process doc I am also eligible for the review. I think we also compensate the contributor for their work even when we decide to close the PR. So I think @eh2077 is also eligible according to some previous similar cases e.g. #7438 (comment), #14232 (comment), #11427 (comment) |
After reviewing internally, we've agreed that payment for $1000 should be paid to @eh2077 and $500 to @thesahindia. Could you both apply to this job: https://www.upwork.com/jobs/~012483cf80c76af86b |
@lschurr Thank you and I applied the job! |
Applied, thanks! |
All paid. I think we can close this one out. |
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:
Expected:
Request payment messages should not change after sending, just like send payment messages.
Actual:
Request message changes & removes some characters such as "<>" from the original message.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.2.69-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
text.mov
Recording.1492.mp4
Expensify/Expensify Issue URL:
Issue reported by: @priyeshshah11
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1675781361590699
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: