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

[Awaiting checklist completion] [$500] No space after emoji or cursor displayed before emoji on android chrome and ios native #29405

Closed
2 of 6 tasks
m-natarajan opened this issue Oct 12, 2023 · 47 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Oct 12, 2023

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: 1.3.81-5
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
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696939352410509

Action Performed:

  1. Open the app
  2. Open any report
  3. Type emoji text in following way ': joy:'
  4. Remove space before text to convert it to emoji
  5. Observe in android chrome, there is no space after emoji and in IOS native, cursor is displayed before emoji

Expected Result:

App should add space after emoji on converting emoji text to emoji

Actual Result:

App does not display space after emoji on android chrome and displays cursor before emoji on IOS native on converting emoji text to emoji when typed in specific way

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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
az_recorder_20231011_202142.1.mp4
android.chrome.space.after.emoji.issue.mp4
iOS: Native
ios.native.space.after.emoji.issue.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0164d5ee2c19ee0a5a
  • Upwork Job ID: 1712265898986901504
  • Last Price Increase: 2023-10-26
  • Automatic offers:
    • aimane-chnaif | Reviewer | 27494949
    • dhanashree-sawant | Reporter | 27494950
Issue OwnerCurrent Issue Owner: @aimane-chnaif
@m-natarajan m-natarajan added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@melvin-bot melvin-bot bot changed the title No space after emoji or cursor displayed before emoji on android chrome and ios native [$500] No space after emoji or cursor displayed before emoji on android chrome and ios native Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@roksanaz
Copy link
Contributor

roksanaz commented Oct 16, 2023

I investigated this issue and I couldn't reproduce it on Android (the space appeared after the emoji on mobile website on Chrome).
As for iOS, I tested other chat apps to search if this is the issue with Expensify app only or rather with iOS, e.g. Slack, and if you type ': joy:' and remove the space between the colon and "j" afterwards, the emoji isn't even converted. Should this issue be treated as a bug or not then?

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

📣 @roksanaz! 📣
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. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. 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>

@twisterdotcom
Copy link
Contributor

It does work on the iOS app and on web, just not the Android app.

And for Slack, they do render it after you remove the space:

29405.mp4

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@roksanaz
Copy link
Contributor

@twisterdotcom About iOS: in Expensify the emoji appears immediately after you remove the space (meaning your cursor is after the first colon symbol), while on Slack you need to manually set the cursor after the second colon symbol. That is why the cursor is in the correct position on Slack and on Expensify it's not.

@melvin-bot melvin-bot bot added the Overdue label Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@twisterdotcom
Copy link
Contributor

Okay cool, so the expected behaviour everywhere is the current web behaviour:

2023-10-19_17-36-10 (1)

I see this does now work on Android, but on iOS the cursor remains at the back of the text, ahead of it.

@melvin-bot melvin-bot bot removed the Overdue label Oct 19, 2023
@roksanaz
Copy link
Contributor

I am Roksana from Callstack - expert contributor group. I’d like to work on this job.

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

@twisterdotcom, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!

@twisterdotcom
Copy link
Contributor

@aimane-chnaif - could we please just assign @roksanaz here?

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2023
@aimane-chnaif
Copy link
Contributor

yes, but still @roksanaz needs to submit proposal before PR

@roksanaz
Copy link
Contributor

Proposal

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

In the native iOS application if the user types the emoji manually, but they unintentionally put a space after the first colon mark (e.g. “: joy:”) and then remove the space, the emoji is converted successfully, but the cursor goes before the emoji instead of after the emoji.

What is the root cause of that problem?

There is a method for setting the cursor position programatically:

if (commentValue !== newComment) {
const remainder = ComposerUtils.getCommonSuffixLength(commentValue, newComment);
setSelection({
start: newComment.length - remainder,
end: newComment.length - remainder,
});

But selection parameter (which indicates the cursor position) is not passed for native iOS platform, because setting selection used to be unstable for iOS in previous versions of React Native (facebook/react-native#29063).

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

selection parameter is not unstable in the version of React Native that is used in the app if implemented correctly (facebook/react-native#29063 (comment)). The implementation used for Expensify is similar to the one quoted. Therefore I suggest to stop omitting this parameter for iOS. We should pass the same props as for Android and web, without omitting the selection prop that is happening here:

// On Android the selection prop is required on the TextInput but this prop has issues on IOS
const propsToPass = _.omit(props, 'selection');

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

@twisterdotcom @aimane-chnaif 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!

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@twisterdotcom
Copy link
Contributor

Ah, missed your comment! Sorry @artus9033. You're assigned now. Thanks!

@aimane-chnaif
Copy link
Contributor

@artus9033 how's it going?

@artus9033
Copy link
Contributor

@artus9033 how's it going?

Still working on fix update due to the unfavorable behaviour of RN's TextInput on iOS, which fires a series of onSelectionChange events after inserting an emoji that causes problems. I am close to the perfect solution and will submit new commits soon.

@artus9033
Copy link
Contributor

Proposal

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

In the native iOS application if the user types the emoji manually, but they unintentionally put a space after the first colon mark (e.g. “: joy:”) and then remove the space, the emoji is converted successfully, but the cursor goes before the emoji instead of after the emoji.

This is an updated approach with regards to #30835 (comment)

What is the root cause of that problem?

There is a way to set the cursor position programatically through a prop passed to TextInput, but the selection parameter (which indicates the cursor position) is not passed for native iOS platform, because setting selection used to be unstable for iOS in previous versions of React Native (facebook/react-native#29063) and causes problems.

The previous proposal involved a momentary behaviour of the cursor jumping to {0, 0}, since it was delaying setting the cursor position to the pre-calculated one. I attempted to overcome this caret behaviour, however on iOS native the original passing of the selection on iOS caused onSelectionChange to be fired sequentially when replacing emoji markers, resulting in unfavorable behaviour of the cursor "jumping around" for a brief moment before being positioned properly by the fix.

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

A solution would be to set a flag to sync cursor position inside onChangeText on iOS specifically by setting it via TextInput ref after all interactions finish, to the position pre-calculated in onSelectionChange.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 13, 2023
@aimane-chnaif
Copy link
Contributor

@youssef-lr since original proposal didn't work on this case, @artus9033 updated proposal with completely different solution.

Copy link

melvin-bot bot commented Dec 21, 2023

@twisterdotcom, @youssef-lr, @artus9033, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Dec 25, 2023

@twisterdotcom, @youssef-lr, @artus9033, @aimane-chnaif Still overdue 6 days?! Let's take care of this!

Copy link

melvin-bot bot commented Dec 27, 2023

@twisterdotcom, @youssef-lr, @artus9033, @aimane-chnaif 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Dec 29, 2023

@twisterdotcom, @youssef-lr, @artus9033, @aimane-chnaif 10 days overdue. I'm getting more depressed than Marvin.

@mountiny
Copy link
Contributor

@kavimuru Based on the comment here this issue was not resolve on ios native @roksanaz @aimane-chnaif

Could you provide more details on this one/ verify this is still not fixed in staging?

@aimane-chnaif
Copy link
Contributor

I am not able to reproduce.
@kavimuru can you please share video?

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Dec 29, 2023
@melvin-bot melvin-bot bot changed the title [$500] No space after emoji or cursor displayed before emoji on android chrome and ios native [HOLD for payment 2024-01-05] [$500] No space after emoji or cursor displayed before emoji on android chrome and ios native Dec 29, 2023
Copy link

melvin-bot bot commented Dec 29, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 29, 2023
Copy link

melvin-bot bot commented Dec 29, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.19-2 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-01-05. 🎊

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Dec 29, 2023

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:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] A discussion in #expensify-bugs 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:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@twisterdotcom
Copy link
Contributor

Wow, this is an old one! Okay. Payment Summary:

Awaiting checklist completion by @aimane-chnaif.

@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Jan 5, 2024
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-01-05] [$500] No space after emoji or cursor displayed before emoji on android chrome and ios native [Awaiting checklist completion] [$500] No space after emoji or cursor displayed before emoji on android chrome and ios native Jan 5, 2024
@aimane-chnaif
Copy link
Contributor

Not able to find offending PR. As the root cause was in upstream, I think this bug always existed from the beginning.

Regression Test Proposal

  1. Open any report and focus on composer
  2. Type emoji text in the following way ': joy:'
  3. Remove space before joy to convert it to emoji
  4. Verify that cursor is displayed after emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants