You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Awaiting checklist] [$250] Tax - App crashes on replacing tax code with emoji #65709
Version Number: V9.1.78-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/6451630 Email or phone of affected tester (no customers): Slottwo1 csm@gmail.com Issue reported by: Applause Internal Team Device used: Redminote 10s android 13 phone App Component: Workspace Settings
Please re-state the problem that we are trying to solve in this issue.
Tax - App crashes on replacing tax code with emoji
What is the root cause of that problem?
validateTaxCode doesn't validate against emoji characters, allowing emojis to be used as tax codes. When setPolicyTaxCode is called with an emoji, it creates Onyx data structures using the emoji as an object key, which causes crashes
Please re-state the problem that we are trying to solve in this issue.
Tax - App crashes on replacing tax code with emoji
What is the root cause of that problem?
Currently we are not having any validation for emojis for the tax code field. When user inputs emoji in the tax code field, we update the route with the emoji value and that breaks the application.
What changes do you think we should make in order to solve the problem?
We need to add the validation for the emojis as well. When user inputs emoji, we should set error for the tax code field so that user won't be able to submit emoji in tax code field.
For that we can update the function here
constvalidateTaxCode=(policy: Policy,values: FormOnyxValues<typeofONYXKEYS.FORMS.WORKSPACE_TAX_CODE_FORM>)=>{consterrors=ValidationUtils.getFieldRequiredErrors(values,[INPUT_IDS_TAX_CODE.TAX_CODE]);consttaxCode=values[INPUT_IDS_TAX_CODE.TAX_CODE];constemojiRegex=/[\p{Emoji_Presentation}\uFE0F]/gu;if(taxCode.length>CONST.TAX_RATES.NAME_MAX_LENGTH){errors[INPUT_IDS_TAX_CODE.TAX_CODE]=translateLocal('common.error.characterLimitExceedCounter',{length: taxCode.length,limit: CONST.TAX_RATES.NAME_MAX_LENGTH,});}elseif(emojiRegex.test(taxCode)){errors[INPUT_IDS_TAX_CODE.TAX_CODE]=translateLocal('invalidTaxCode');// we will use proper transalation in actual // code i have just added this as a sample string here for now.}elseif(policy?.taxRates?.taxes&&ValidationUtils.isExistingTaxCode(taxCode,policy.taxRates.taxes)){errors[INPUT_IDS_TAX_CODE.TAX_CODE]=translateLocal('workspace.taxes.error.taxCodeAlreadyExists');}returnerrors;};
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
App crashes when replace tax code name with emoji.
This issue happens to other forms too that allow emoji, such as categories, tags, etc.
What is the root cause of that problem?
The issue stems from the react-navigation code. Using emoji as the route path works fine because we encode it, but it crashes after this upstream PR.
In that PR, we only want to encode non-valid characters by splitting the characters that matches the non-valid set and then being encoded.
However, since emojis could contain multiple Unicode, it's being split into a single Unicode and encodeURIComponent can't handle it. For example, 😁 becomes ['\uD83D', '\uDE01']
What changes do you think we should make in order to solve the problem?
We can split the characters into an array first by using Array.form, iterate over each character, and only encode the ones that are non-valid.
changed the title [-]Tax - App crashes on replacing tax code with emoji[/-][+][$250] Tax - App crashes on replacing tax code with emoji[/+]on Jul 9, 2025
changed the title [-][Due for payment 2025-07-28] [$250] Tax - App crashes on replacing tax code with emoji[/-][+][Awaiting checklist] [$250] Tax - App crashes on replacing tax code with emoji[/+]on Jul 29, 2025
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: Not critical
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jul 9, 2025
Triggered auto assignment to @twisterdotcom (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.ryntgh commentedon Jul 9, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tax - App crashes on replacing tax code with emoji
What is the root cause of that problem?
validateTaxCodedoesn't validate against emoji characters, allowing emojis to be used as tax codes. WhensetPolicyTaxCodeis called with an emoji, it creates Onyx data structures using the emoji as an object key, which causes crashesApp/src/libs/actions/TaxRate.ts
Lines 65 to 79 in 58229fe
What changes do you think we should make in order to solve the problem?
We can add emoji validation to the
validateTaxCodefunction using the existingCONST.REGEX.ALL_EMOJISto prevent tax code with emojiWe should create a new translation for the error as well
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
N/A
Burhan-Rashid commentedon Jul 9, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Tax - App crashes on replacing tax code with emoji
What is the root cause of that problem?
Currently we are not having any validation for emojis for the tax code field. When user inputs emoji in the tax code field, we update the route with the emoji value and that breaks the application.
App/src/pages/workspace/taxes/WorkspaceTaxCodePage.tsx
Lines 35 to 48 in 9b9f059
App/src/libs/actions/TaxRate.ts
Lines 65 to 79 in 58229fe
What changes do you think we should make in order to solve the problem?
We need to add the validation for the emojis as well. When user inputs emoji, we should set error for the tax code field so that user won't be able to submit emoji in tax code field.
For that we can update the function here
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
bernhardoj commentedon Jul 9, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes when replace tax code name with emoji.
This issue happens to other forms too that allow emoji, such as categories, tags, etc.
What is the root cause of that problem?
The issue stems from the
react-navigationcode. Using emoji as the route path works fine because we encode it, but it crashes after this upstream PR.In that PR, we only want to encode non-valid characters by splitting the characters that matches the non-valid set and then being encoded.
However, since emojis could contain multiple Unicode, it's being split into a single Unicode and
encodeURIComponentcan't handle it. For example,😁becomes['\uD83D', '\uDE01']What changes do you think we should make in order to solve the problem?
We can split the characters into an array first by using
Array.form, iterate over each character, and only encode the ones that are non-valid.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update the test in upstream repo
What alternative solutions did you explore? (Optional)
Revert the upstream PR.
twisterdotcom commentedon Jul 9, 2025
Wow. I guess when you're making a new app in 2025, you have to support the millennials and gen Zers who now put emoji in their tax codes.
[-]Tax - App crashes on replacing tax code with emoji[/-][+][$250] Tax - App crashes on replacing tax code with emoji[/+]melvin-bot commentedon Jul 9, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021942974140675296489
melvin-bot commentedon Jul 9, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (
External)rushatgabhane commentedon Jul 9, 2025
this is too funny 🤣
23 remaining items
melvin-bot commentedon Jul 28, 2025
Payment Summary
Upwork Job
BugZero Checklist (@twisterdotcom)
twisterdotcom commentedon Jul 29, 2025
@rushatgabhane please complete the checklist. @bernhardoj please go ahead and request payment.
[-][Due for payment 2025-07-28] [$250] Tax - App crashes on replacing tax code with emoji[/-][+][Awaiting checklist] [$250] Tax - App crashes on replacing tax code with emoji[/+]bernhardoj commentedon Jul 29, 2025
Requested in ND.
rushatgabhane commentedon Jul 29, 2025
requested pay
twisterdotcom commentedon Jul 29, 2025
I still think we need the checklist though right?
rushatgabhane commentedon Jul 29, 2025
yes we do, I'll submit it soon
melvin-bot commentedon Aug 1, 2025
@rushatgabhane Whoops! This issue is 2 days overdue. Let's get this updated quick!
rushatgabhane commentedon Aug 4, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: fix: Adjust URL encoding to avoid encoding unnecessarily react-navigation/react-navigation#11867
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: Not critical
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/533024
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
twisterdotcom commentedon Aug 4, 2025
I amended the payment summary above here: #65709 (comment)
JmillsExpensify commentedon Aug 20, 2025
$250 approved for @bernhardoj