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 2022-01-11] New Chat Room - Letters are doubled when entering Room Name #6725

Closed
isagoico opened this issue Dec 12, 2021 · 30 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@isagoico
Copy link

isagoico commented Dec 12, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Log in with a expensifail account
  2. Click on global create
  3. Create new chat room
  4. Start typing on room name

Expected Result:

Characters should not be doubled

Actual Result:

Characters are doubled with each type

Workaround:

Unable to type name correctly.

Platform:

Where is this issue occurring?

  • Android

Version Number: 1.1.20-0

Reproducible in staging?: Yes
Reproducible in production?: No

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

20211212_154634.1.mp4

**Issue reported by:**Applause
Job Post: https://www.upwork.com/jobs/~01404fae44cf52f88e

View all open jobs on GitHub

@isagoico isagoico added DeployBlockerCash This issue or pull request should block deployment Engineering Daily KSv2 labels Dec 12, 2021
@MelvinBot
Copy link

Triggered auto assignment to @tgolen (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@github-actions github-actions bot added Hourly KSv2 and removed Daily KSv2 labels Dec 12, 2021
@mountiny
Copy link
Contributor

This is also related to #6314 cc @TomatoToaster

@TomatoToaster
Copy link
Contributor

I can take a look at this one. Looks like this is happening only on android which is weeird.

@mountiny
Copy link
Contributor

It is also only happening only if you click by mouse on the emulator keyboard and not when you actually type using notebook keyboard 🤯

@TomatoToaster
Copy link
Contributor

Alright since this is behind a beta, I'm going to demote this from being a deployblocker, but I'll keep track of this bug as I'm working on this PR: #6737

@TomatoToaster TomatoToaster added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 13, 2021
@TomatoToaster
Copy link
Contributor

Haven't figured out this one yet, once the Auth PR fixing the PolicyRoom logic goes to production I think this could become external since the New Room component is available in main and this bug is related to the modal, not policy rooms themselves.

@MelvinBot MelvinBot removed the Overdue label Dec 15, 2021
@TomatoToaster
Copy link
Contributor

Before making this external, @jasperhuangg would you happen to know the solution to this? I think it has to do with the android file for the prefix text box. It seems like this is only apparent in the emulator when you use the on-screen keyboard.

@TomatoToaster
Copy link
Contributor

Hadn't gotten time to work on this yet. I'm going to unassign myself for the moment since I won't be able to get to it in a while.

@MelvinBot MelvinBot removed the Overdue label Dec 22, 2021
@TomatoToaster TomatoToaster removed their assignment Dec 22, 2021
@mountiny
Copy link
Contributor

We can make this External even if Jasper would want to have a look, but better to let contributors know. This seems like a typo of an issue contributors will be able to fix. Gonna take this on as CME! :)

@mountiny mountiny self-assigned this Dec 22, 2021
@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Dec 22, 2021
@MelvinBot
Copy link

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

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 23, 2021
@MelvinBot
Copy link

Current assignee @mountiny is eligible for the Exported assigner, not assigning anyone new.

@awesome1128
Copy link

I know why it's happening. I've fixed such issue 1 week ago.
Cui.

@awesome1128
Copy link

image
How can I put my email?
I want to have a chat in private channel.
Thanks.
Cui

@awesome1128
Copy link

Hey please let me know. I am ready to fix your issue right now because I've fixed such issue 1 week ago.
I would like to discuss further in private chat. How can we have a chat?

Thanks, Cui.

@parasharrajat
Copy link
Member

Hi @awesome1128 ,

As per our policy, could you please put together a proposal explaining the following:

  1. What is causing this bug?
  2. Were you able to reproduce this?
  3. What steps will you take to resolve this?
  4. Your proposal should touch part of our code base.

Thanks.

@awesome1128
Copy link

awesome1128 commented Dec 23, 2021

Yeah, but I will explain it in private chat.
If I explain enough, you can fix it yourself, so it does not make sense how I can work on this project.
Please let me know.
Thanks.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Dec 23, 2021

@awesome1128

Please read our contributing guidelines.

Go through closed issues, know about the process. Make a formal proposal here.

@parasharrajat
Copy link
Member

parasharrajat commented Dec 23, 2021

@awesome1128 This is necessary to understand what would you change in the codebase and how will it impact our app. Secondly, we pay the contributor if we use their solution but you would be submitting a PR with the solution if accepted.

@CamilaRivera
Copy link
Contributor

CamilaRivera commented Dec 28, 2021

The problem is the auto-capitalization behaviour present in TextInput for Android (prop documentation). The default value for the prop autoCapitalize seems to be "sentences". The auto-capitalization is not working well with our logic that applies some transformations to the text when it changes:

checkAndModifyRoomName(roomName) {
const modifiedRoomNameWithoutHash = roomName.substr(1)
.replace(/ /g, '_')
.replace(/[^a-zA-Z\d_]/g, '')
.substr(0, CONST.REPORT.MAX_ROOM_NAME_LENGTH)
.toLowerCase();
const finalRoomName = `#${modifiedRoomNameWithoutHash}`;
const isExistingRoomName = _.some(
_.values(this.props.reports),
report => report && report.policyID === this.state.policyID && report.reportName === finalRoomName,
);
if (isExistingRoomName) {
this.setState({error: this.props.translate('newRoomPage.roomAlreadyExists')});
} else {
this.setState({error: ''});
}
return finalRoomName;
}

Proposal

Pass prop autoCapitalize="none" to the TextInput here:

<TextInput
style={[
styles.textInputWithPrefix.textInput,
styles.noOutline,
{height: 40},
]}
onChangeText={text => props.onChangeText(`${props.prefixCharacter}${text}`)}
// eslint-disable-next-line react/jsx-props-no-spreading
{..._.omit(props, ['prefixCharacter', 'errorText', 'onChangeText'])}
/>

The component TextInputWithPrefix is not being currently used anywhere else, so I would suggest doing the simplest and hardcoding the prop to "none" there, but, if we wanted to disable the autoCapitalize only for the room name input, we can add an extra prop to TextInputWithPrefix:

  • Modify TextInputWithPrefix defaultProps and propTypes to receive autoCapitalize as a prop
  • Modify TextInputWithLabel in the same way to drill down the prop autoCapitalize
  • Pass autoCapitalize="none" to TextInputWithLabel here:
    <TextInputWithLabel
    label={this.props.translate('newRoomPage.roomName')}
    prefixCharacter="#"
    placeholder={this.props.translate('newRoomPage.social')}
    containerStyles={[styles.mb5]}
    onChangeText={roomName => this.setState({roomName: this.checkAndModifyRoomName(roomName)})}
    value={this.state.roomName.substr(1)}
    errorText={this.state.error}
    />

@mountiny
Copy link
Contributor

@CamilaRivera This proposal looks great! I think I would like to make this a little bit more general so adding the autoCapitalize as props to TextInputWithPrefix and pass default props as is the default per TextInput documentation will give us more wiggle room in future.

Just to confirm, have you tried the hardcoded solution and confirmed this will indeed solve this Android specific issue?

@mountiny
Copy link
Contributor

mountiny commented Dec 28, 2021

@CamilaRivera Confirmed the hardcoded version works! 🎉 Let's fix this together 😊 Feel free to submit a PR with the general solution as you have described above. Please, apply for the Upwork job which is linked in the issue body.

@kevinksullivan Can you please Camila? Thank you very much 🙌

@MelvinBot
Copy link

📣 @CamilaRivera You have been assigned to this job by @mountiny!
Please apply to this job in Upwork 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 📖

@MelvinBot MelvinBot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 28, 2021
@parasharrajat
Copy link
Member

parasharrajat commented Dec 28, 2021

Nice timing @mountiny , I was just looking at it.

🎀 👀 🎀 C+ reviewed

@CamilaRivera
Copy link
Contributor

@CamilaRivera This proposal looks great! I think I would like to make this a little bit more general so adding the autoCapitalize as props to TextInputWithPrefix and pass default props as is the default per TextInput documentation will give us more wiggle room in future.

Just to confirm, have you tried the hardcoded solution and confirmed this will indeed solve this Android specific issue?

Yes, I tried the hardcoded solution. Thanks, @mountiny! I will send my PR with a more general approach as you suggested. I just applied for the Upwork job.

@kevinksullivan
Copy link
Contributor

Hired on upwork @CamilaRivera .

@botify botify added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 4, 2022
@botify botify changed the title New Chat Room - Letters are doubled when entering Room Name [HOLD for payment 2022-01-11] New Chat Room - Letters are doubled when entering Room Name Jan 4, 2022
@botify
Copy link

botify commented Jan 4, 2022

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.24-19 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 2022-01-11. 🎊

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@kevinksullivan
Copy link
Contributor

Paid in upwork. Thanks @CamilaRivera !

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 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests