Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[HOLD for payment 2023-07-21] [$1000] Spanish character to room name shows the invalid name #21755

Closed kavimuru closed 1 year ago

kavimuru commented 1 year ago

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:

  1. Open App, Press FAB > New room
  2. Add Spanish character to the Room name (e.g. cueva-de-opinión)

Expected Result:

We should not get the error of invalid Room name and the Spanish character should be a valid name

Actual Result:

Adding a Spanish character shows the error of an invalid room name

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?

Version Number: 1.3.33-4 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: Any additional supporting documentation

https://github.com/Expensify/App/assets/43996225/8c71790f-4fef-488f-9e78-86e7199cef24

https://github.com/Expensify/App/assets/43996225/46037323-60f2-4df2-aa3a-1e5eac96cae5

Expensify/Expensify Issue URL: Issue reported by: @jayeshmangwani Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687765941593149

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01082e3b04cd3dad37
  • Upwork Job ID: 1674121959020658688
  • Last Price Increase: 2023-06-28
melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

kavimuru commented 1 year ago

Proposal

from @jayeshmangwani

Please re-state the problem that we are trying to solve in this issue.

Spanish character to room name shows the invalid name.

What is the root cause of that problem?

Here on the RoomNamePage page, we check the validity of the room name from the isValidRoomName function and

https://github.com/Expensify/App/blob/ae8a751c04cd4b371bec1d976da204413b6bb4b9/src/pages/settings/Report/RoomNamePage.js#L52-L54

https://github.com/Expensify/App/blob/ae8a751c04cd4b371bec1d976da204413b6bb4b9/src/libs/ValidationUtils.js#L424-L426

isValidRoomName check the valid room name with this regex;

https://github.com/Expensify/App/blob/ae8a751c04cd4b371bec1d976da204413b6bb4b9/src/CONST.js#L1135

above regex check the English character from a to z, but it does not allow Spanish character like é

What changes do you think we should make in order to solve the problem?

We have to update the regex here like that it can accept all the valid Spanish characters; we need to add the new range for taking the Spanish characters à-ÿ to ROOM_NAME regex.

https://github.com/Expensify/App/blob/ae8a751c04cd4b371bec1d976da204413b6bb4b9/src/CONST.js#L1135

    ROOM_NAME: /^#[a-z0-9-]{1,80}$/,
    ROOM_NAME: /^#[a-z0-9à-ÿ-]{1,80}$/,

What alternative solutions did you explore? (Optional)

Rather than adding the whole range of the alphabet, we can add only missing Spanish characters to the regex.

https://github.com/Expensify/App/blob/ae8a751c04cd4b371bec1d976da204413b6bb4b9/src/CONST.js#L1135

    ROOM_NAME: /^#[a-z0-9-]{1,80}$/,
    ROOM_NAME: /^#[a-z0-9-ñáéíóúü]{1,80}$/,
samh-nl commented 1 year ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Accented Spanish characters are not permitted in room names.

What is the root cause of that problem?

The ValidationUtils.isValidRoomName method does not take into account accented Latin (including Spanish) characters.

What changes do you think we should make in order to solve the problem?

Extend the regular expression defined in REGEX.ROOM_NAME (CONST.js) to include:

\u{00c0}-\u{024f}\u{1e00}-\u{1eff}

Which will allow accented Latin characters, including Spanish, to be added to room names.

What alternative solutions did you explore? (Optional)

Allowing Spanish characters specifically. However, this would be a hacky temporary solution as the broader problem is that accented Latin characters are currently disallowed, which for example also includes French accented characters.

melvin-bot[bot] commented 1 year ago

📣 @samh-nl! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
melvin-bot[bot] commented 1 year ago

⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

samh-nl commented 1 year ago

Contributor details Your Expensify account email: h.sam.lw@gmail.com Upwork Profile Link: https://upwork.com/freelancers/~016c982fe69f86aff8

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~01082e3b04cd3dad37

melvin-bot[bot] commented 1 year ago

Current assignee @laurenreidexpensify is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav (External)

laurenreidexpensify commented 1 year ago

@0xmiroslav do any of the proposals above look good?

laurenreidexpensify commented 1 year ago

@0xmiroslav bump^^

0xmiros commented 1 year ago

@samh-nl can you please share the source link of that regex which supports Latin characters?

jayeshmangwani commented 1 year ago

@0xmiroslav Do you have any feedback for my Proposal ?

0xmiros commented 1 year ago

@jayeshmangwani your proposal sounds good but checking to see if we can apply more general solution.

jayeshmangwani commented 1 year ago

your proposal sounds good but checking to see if we can apply more general solution.

@0xmiroslav It will be applicable for all the Spanish characters, and We have a similar regex already in use, À-ÿ in the below regex is used for Spanish small case and uppercase alphabets

https://github.com/Expensify/App/blob/8b7a65dcd36fa2b47ffb39c69f2cb294b94a7171/src/CONST.js#L1121

0xmiros commented 1 year ago

@jayeshmangwani ok great! As it's aligned with other name validation, it's fine to use à-ÿ for now. Before approving, can you please test all Spanish alphabets with this range?

samh-nl commented 1 year ago

@0xmiroslav Here is a regex tester with this regular expression, showing it's applicability: https://regex101.com/r/yvmwco/1 (multiline and global flags added for ease of reading)

It takes parts of Latin-1 Supplement, Latin Extended-A, Latin Extended-B and Latin Extended Additional.

The Spanish characters are contained within these standards, which I can validate manually.

jayeshmangwani commented 1 year ago

@jayeshmangwani ok great! As it's aligned with other name validation, it's fine to use à-ÿ for now. Before approving, can you please test all Spanish alphabets with this range?

Screenshot 2023-07-03 at 8 52 08 PM

@0xmiroslav tested with all Spanish alphabets

0xmiros commented 1 year ago

I like @jayeshmangwani's proposal. @samh-nl thanks for sharing links. For now, we're supporting only English and Spanish, a-zà-ÿ should be enough to fix this issue and it's already aligned with legal name validation regex. We can always revisit all regexes when we support more languages in the future. 🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 1 year ago

📣 @0xmiroslav You have been assigned to this job! Please apply to this job in Upwork here and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] commented 1 year ago

📣 @jayeshmangwani 🎉 An offer has been automatically sent to your Upwork account 🎉

Contributor - [$1000] Spanish character to room name shows the invalid name Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] commented 1 year ago

📣 @jayeshmangwani 🎉 An offer has been automatically sent to your Upwork account 🎉

Reporter - [$1000] Spanish character to room name shows the invalid name

laurenreidexpensify commented 1 year ago

Sorry folks I broke the order here! Still waiting for @youssef-lr to sign off on the proposal https://github.com/Expensify/App/issues/21755#issuecomment-1618665262

youssef-lr commented 1 year ago

Looks good to me @laurenreidexpensify!

melvin-bot[bot] commented 1 year ago

📣 @0xmiroslav We're missing your Upwork ID to automatically send you an offer for the Reviewer role. Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!

melvin-bot[bot] commented 1 year ago

📣 @jayeshmangwani 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] commented 1 year ago

📣 @jayeshmangwani 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Upwork job

jayeshmangwani commented 1 year ago

@0xmiroslav PR is ready for review,

@laurenreidexpensify I have accepted these 2 offers (https://github.com/Expensify/App/issues/21755#issuecomment-1619735243 , https://github.com/Expensify/App/issues/21755#issuecomment-1619735320) before, should I ignore these 2 offers (https://github.com/Expensify/App/issues/21755#issuecomment-1623616663 , https://github.com/Expensify/App/issues/21755#issuecomment-1623616773)?

jayeshmangwani commented 1 year ago

@0xmiroslav bump for review

melvin-bot[bot] commented 1 year ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 1 year ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.40-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-07-21. :confetti_ball:

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

melvin-bot[bot] commented 1 year ago

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:

laurenreidexpensify commented 1 year ago

@0xmiroslav can you complete the steps above? Thanks!

laurenreidexpensify commented 1 year ago

Waiting on @0xmiroslav for final steps here

youssef-lr commented 1 year ago

Not overdue. Waiting for checklist.

laurenreidexpensify commented 1 year ago

Payment Summary:

0xmiros commented 1 year ago

We added Spanish validation in unit test so no further regression test step is needed.

0xmiros commented 1 year ago

This is eligible for timeline bonus

0xmiros commented 1 year ago

@laurenreidexpensify can you please hold my payment until further notice? I am working on some stuff due to recent measurements in my region. And update issue to Monthly. Thanks

laurenreidexpensify commented 1 year ago

Payment Summary Update:

laurenreidexpensify commented 1 year ago

@0xmiroslav can we pay this yet?

0xmiros commented 1 year ago

@laurenreidexpensify still in discussion. Thanks for your patience. This issue can be updated weekly

jayeshmangwani commented 1 year ago

@laurenreidexpensify I have been paid for the reporter, but job is showing as Work in progress at Upwork , Can you please End contract from your side at Upwork?

laurenreidexpensify commented 1 year ago

@jayeshmangwani ah sorry for confusion. I paid everything in one contract, have closed out the other contract now.

laurenreidexpensify commented 1 year ago

@0xmiroslav are we good to pay this one yet?

0xmiros commented 1 year ago

@laurenreidexpensify let's close this for now. I am tracking locally.