-
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
[CP Staging] input of '[' and other special characters fixed #30559
Merged
neil-marcellini
merged 10 commits into
Expensify:main
from
HardikChoudhary24:fix/input-error
Oct 30, 2023
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7bbc841
input of '[' and other special characters fixed
HardikChoudhary24 c145333
lint error fixed
HardikChoudhary24 c4cc971
suggested changes applied
HardikChoudhary24 fbc466b
Merge remote-tracking branch 'upstream/main' into fix/input-error
HardikChoudhary24 7054c51
test for convertToLTRForComposer added
HardikChoudhary24 a2c2025
test case added
HardikChoudhary24 c449904
lint fixed
HardikChoudhary24 9bd0b5f
lint fixed
HardikChoudhary24 f6eede0
OS check removed
HardikChoudhary24 d28b633
lint fixed
HardikChoudhary24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, when does this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the root cause of this bug? Why only
[
not working but all other special characters work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because
[
has a special meaning in regular expressions andCONST.UNICODE.LTR.match('[')
gives an error because[
is not properly escaped. If we do'CONST.UNICODE.LTR.match(/\[/)
it will give null which we require but when we are passing a string we are just passing[
. This also happens for?
,+
due to the same reason.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Can you think of adding automated test cases? As you see, this might easily break composer input and affect bad user experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will add automated test cases. Should I raise a new PR for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next deploy will be tomorrow (Monday) so if you can add them before that, that would be great.
Otherwise, we need to merge this before deploy to staging and work on unit test as a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't be able to complete the task before tomorrow as my current workload won't permit me to meet that deadline. Can we do it as a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with it. cc: @neil-marcellini