Skip to content
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

[HOLD for payment 2024-11-28] [$250] Status- Unable to set correct emoji for status in user's profile #52071

Closed
1 of 8 tasks
IuliiaHerets opened this issue Nov 5, 2024 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 5, 2024

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: v9.0.57-8
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/5183239&group_by=cases:section_id&group_order=asc&group_id=229064
Email or phone of affected tester (no customers): applausetester+ck11052@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com & log in with new account
  2. Go to Settings
  3. Click the status icon
  4. Select any emoji]
  5. Enter message >> select Today >> click save

Expected Result:

Correct emoji should be displayed at top right in settings modal next to user's account

Actual Result:

Unable to set correct emoji for status in user's profile

Workaround:

Inknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6643635_1729710869754.20241024_031118.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021854955374414588963
  • Upwork Job ID: 1854955374414588963
  • Last Price Increase: 2024-11-08
  • Automatic offers:
    • daledah | Contributor | 104885180
Issue OwnerCurrent Issue Owner: @alitoshmatov
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 5, 2024
Copy link

melvin-bot bot commented Nov 5, 2024

Triggered auto assignment to @bfitzexpensify (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
Copy link
Author

Issue is repro only on Mac/Safari

@daledah
Copy link
Contributor

daledah commented Nov 5, 2024

Edited by proposal-police: This proposal was edited at 2024-11-06 00:01:04 UTC.

Proposal

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

  • Unable to set correct emoji for status in user's profile

What is the root cause of that problem?

  • When submiting the status form, it calls ValidationUtils.prepareValues(inputValues):

const trimmedStringValues = shouldTrimValues ? ValidationUtils.prepareValues(inputValues) : inputValues;

which will convert any emoji value to ''. But why?

  • In prepareValues function, it calls:

trimmedStringValues[inputID] = StringUtils.removeInvisibleCharacters(inputValue);

which will remove invisible characters from a string.

  • In removeInvisibleCharacters, we call:

part.replace(/[\p{Cc}\p{Cs}\p{Co}\p{Cn}]/gu, ''),

to remove all the characters from the 'Other' (C) category except for format characters (Cf). In here, we have the difference between Chrome and Safari due to Safari’s limited support for Unicode property escapes (like \p{Cs}).

  • \p{Cs} is a Unicode property that matches surrogate characters. In Chrome, the regex /[\p{Cs}]/gu correctly interprets surrogate pairs and removes only surrogate characters outside the BMP if they match. In Safari, without full support for \p{Cs}, Safari may treat the whole string as a match or fail to apply the regex correctly.

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

  • To avoid this issue, we can detect surrogate pairs with an alternative regex that does not rely on \p{Cs}, by using \uD800-\uDBFF instead:

part.replace(/[\p{Cc}\p{Cs}\p{Co}\p{Cn}]/gu, ''),

            part.replace(/([\uD800-\uDBFF][\uDC00-\uDFFF])|[\p{Cc}\p{Co}\p{Cn}]/gu, ''),
  • We can only apply the above in case of safari by using Browser.isSafari() check, otherwise, leave it as it is.

What alternative solutions did you explore? (Optional)

@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Nov 8, 2024
@melvin-bot melvin-bot bot changed the title Status- Unable to set correct emoji for status in user's profile [$250] Status- Unable to set correct emoji for status in user's profile Nov 8, 2024
Copy link

melvin-bot bot commented Nov 8, 2024

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

@melvin-bot melvin-bot bot added Overdue Help Wanted Apply this label when an issue is open to proposals by contributors labels Nov 8, 2024
Copy link

melvin-bot bot commented Nov 8, 2024

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

@FitseTLT
Copy link
Contributor

Can't reproduce this.

@melvin-bot melvin-bot bot added the Overdue label Nov 11, 2024
@daledah
Copy link
Contributor

daledah commented Nov 12, 2024

I can reproduce. What about you @alitoshmatov?

Copy link

melvin-bot bot commented Nov 12, 2024

@bfitzexpensify, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@alitoshmatov
Copy link
Contributor

I also can't reproduce. @IuliiaHerets Looks like OP has different recording, can you provide recording for this issue

@melvin-bot melvin-bot bot removed the Overdue label Nov 12, 2024
@daledah
Copy link
Contributor

daledah commented Nov 12, 2024

@alitoshmatov You tested in Chrome or Safari? The issue is only reproducible in safari.

@alitoshmatov
Copy link
Contributor

Oh I see, I was able to reproduce on Safari

@alitoshmatov
Copy link
Contributor

@daledah Thank you for detailed explanation, your RCA is correct and solve the issue

We can go with @daledah 's proposal

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Nov 13, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

📣 @daledah 🎉 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 📖

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Nov 14, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 14, 2024
@daledah
Copy link
Contributor

daledah commented Nov 14, 2024

@alitoshmatov PR is ready.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 21, 2024
@melvin-bot melvin-bot bot changed the title [$250] Status- Unable to set correct emoji for status in user's profile [HOLD for payment 2024-11-28] [$250] Status- Unable to set correct emoji for status in user's profile Nov 21, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 21, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

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

Copy link

melvin-bot bot commented Nov 21, 2024

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

If no regressions arise, payment will be issued on 2024-11-28. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 21, 2024

@alitoshmatov @bfitzexpensify @alitoshmatov The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 27, 2024
@bfitzexpensify
Copy link
Contributor

Payment complete to @daledah - @alitoshmatov, please complete the BZ checklist and I'll complete the payment summary for the C+ work

Copy link

melvin-bot bot commented Dec 2, 2024

@thienlnam, @bfitzexpensify, @alitoshmatov, @daledah Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@alitoshmatov
Copy link
Contributor

alitoshmatov commented Dec 2, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [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: https://github.com/Expensify/App/pull/27414/files#r1865846527

  • [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: No need

  • [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.

    Existing tests should cover this case

@alitoshmatov
Copy link
Contributor

@bfitzexpensify Completed the checklist

@bfitzexpensify
Copy link
Contributor

Thanks!

Payment summary:

@alitoshmatov to be paid $250 for C+ work via manual request
@daledah has been paid $250 via Upwork for contirbutor work ✅

@JmillsExpensify
Copy link

$250 approved for @alitoshmatov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants