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.51k stars 2.87k forks source link

[Awaiting Payment Sept 15th][$125] Room-mWeb-Inconsistency in Character allowed to create room from fab & via mentions #48168

Closed IuliiaHerets closed 1 month ago

IuliiaHerets commented 2 months 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!


Version Number: 9.0.25 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4896867 Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap fab - start chat -- room
  3. Paste the room name - 345688988765544445665555444555455555555555555555555555555552357777dfghgggggggg5muuuddu
  4. Create a room
  5. Via mentions create another room with same number of characters - 345688988765544445665555444555455555555555555555555555555552357777dfghgggggggg6muuuddp
  6. Note user not shown whisper to create room with all characters entered

Expected Result:

There must be consistency in Character allowed to create room from fab & via mentions.

Actual Result:

Inconsistency in Character allowed to create room from fab & via mentions.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/8cf9e4c0-a756-4907-907f-0ffcde81a30f

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018f61735c851b2aec
  • Upwork Job ID: 1829102787350296440
  • Last Price Increase: 2024-08-29
  • Automatic offers:
    • alitoshmatov | Reviewer | 103992433
    • NJ-2020 | Contributor | 103992435
Issue OwnerCurrent Issue Owner: @trjExpensify
melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @trjExpensify (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.

IuliiaHerets commented 2 months ago

@trjExpensify 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

NJ-2020 commented 2 months ago

Edited by proposal-police: This proposal was edited at 2024-08-29 14:11:05 UTC.

Proposal

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

Room-mWeb-Inconsistency in Character allowed to create room from fab & via mentions

What is the root cause of that problem?

Inside the expensify-common, we limit up to 80 characters only https://github.com/Expensify/expensify-common/blob/331f53580a4ddd7f1c8e73c7c1494d0bb22962c7/lib/ExpensiMark.ts#L298-L303

{
    name: 'reportMentions',
    regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,80})(?![^<]*(?:<\/pre>|<\/code>|<\/a>))/gimu,
    replacement: '<mention-report>$1</mention-report>',
},

But here in our case we mention the room name more than 80 characters, which 87 in our case

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

We can change the limit to 99 to match in our FE as the max of the room name length, so it will be:

{
    name: 'reportMentions',
    regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,99})(?![^<]*(?:<\/pre>|<\/code>|<\/a>))/gimu,
    replacement: '<mention-report>$1</mention-report>',
},

I also think we don't need to update the react-native-live-markdown because it already synced with expensify-common meaning the limit for reportMentions is up to expensify-common so when we fix the expensify-common, the react-native-live-markdown will be automatically fixed by updating to expensify-common to the latest version and build it again

What alternative solutions did you explore? (Optional)

FitseTLT commented 2 months ago

Edited by proposal-police: This proposal was edited at 2024-08-28 13:01:34 UTC.

Proposal

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

Room-mWeb-Inconsistency in Character allowed to create room from fab & via mentions

What is the root cause of that problem?

We are allowing only 80 characters when we parse reportMenions in common But the room name character limit we are using in FE is 99 here https://github.com/Expensify/App/blob/ac5ee2ef790231c67ca3ddb14dc481d77da5bcea/src/CONST.ts#L917

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

We need to be consistent and pick a max limit value and ensure that same value is used in both places The easiest thing might be to change the max room name length here to 80 same as the expensify-common parsing https://github.com/Expensify/App/blob/ac5ee2ef790231c67ca3ddb14dc481d77da5bcea/src/CONST.ts#L917

but if we want the reverse we can update the expensify-common code

{
    name: 'reportMentions',
    regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,99})(?![^<]*(?:<\/pre>|<\/code>|<\/a>))/gimu,
    replacement: '<mention-report>$1</mention-report>',
},

What alternative solutions did you explore? (Optional)

dominictb commented 2 months ago

Edited by proposal-police: This proposal was edited at 2024-08-29 09:13:32 UTC.

Proposal

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

What is the root cause of that problem?

What alternative solutions did you explore? (Optional)

dominictb commented 2 months ago

Proposal updated

melvin-bot[bot] commented 2 months ago

⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

trjExpensify commented 2 months ago

I agree we should be consistent here, but this is a quick fix, so I'm dropping the price.

melvin-bot[bot] commented 2 months ago

Job added to Upwork: https://www.upwork.com/jobs/~018f61735c851b2aec

melvin-bot[bot] commented 2 months ago

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

NJ-2020 commented 2 months ago

Proposal Updated

dominictb commented 2 months ago

Proposal updated

NJ-2020 commented 2 months ago

Proposal updated

alitoshmatov commented 1 month ago

Seems very straightforward task and all proposals are suggesting the same solution. I think we can go with @NJ-2020 's proposal. Even without edits his original proposal suggested to update mention name length

C+ reviewed 🎀 👀 🎀

melvin-bot[bot] commented 1 month ago

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

NJ-2020 commented 1 month ago

@alitoshmatov PR ready for review

melvin-bot[bot] commented 1 month ago

@trjExpensify, @stitesExpensify, @alitoshmatov Whoops! This issue is 2 days overdue. Let's get this updated quick!

trjExpensify commented 1 month ago

Payment summary as follows:

Doesn't look like @alitoshmatov actually reviewed the PR here, so I reduced partial payment of $75 for the proposal review only.

Let me know if that's correct, and I'll issue payments after the regression period.

trjExpensify commented 1 month ago

Melv, go away. @alitoshmatov @NJ-2020, we might need a version bump of expensify-common here actually?

NJ-2020 commented 1 month ago

@trjExpensify Yes we need to bump the expensify-common to the latest version

trjExpensify commented 1 month ago

Cool, and will you raise a PR for that?

NJ-2020 commented 1 month ago

@trjExpensify PR ready

Just to confirm that we only need to update the expensify-common version to the latest version inside react-native-live-markdown only?

trjExpensify commented 1 month ago

I'll defer to @alitoshmatov on that. 👍

alitoshmatov commented 1 month ago

@trjExpensify Everything looks good for me

melvin-bot[bot] commented 1 month ago

@trjExpensify @stitesExpensify @alitoshmatov this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

trjExpensify commented 1 month ago

Great, so we should be good here when payment is due.

melvin-bot[bot] commented 1 month ago

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

Offer link Upwork job

melvin-bot[bot] commented 1 month ago

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

Offer link 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 📖

trjExpensify commented 1 month ago

Okay, offers have been sent. Please accept, and I'll modify accordingly to match this payment summary and close it out.

trjExpensify commented 1 month ago

Settled up, closing!