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 2023-08-02] [HOLD for payment 2023-08-01] [$1000] Web - The first letter of the chat name is cut #22997

Closed
1 of 6 tasks
kbecciv opened this issue Jul 17, 2023 · 44 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

@kbecciv
Copy link

kbecciv commented Jul 17, 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!


Action Performed:

  1. Go to any chat with other user
  2. add "/settings" to the address in address bar (like "https://new.expensify.com/r/4148003058225040/settings")
  3. Open Room Name
  4. Notice that name is "hat Report", first letter is cut

Expected Result:

he name should be the same as on previous page

Actual Result:

The first letter of the chat name is cut

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.40-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
Notes/Photos/Videos: Any additional supporting documentation

2023-07-17.10.00.20.mov
Recording.3686.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0196a1bf7800ad8925
  • Upwork Job ID: 1680963664829435904
  • Last Price Increase: 2023-07-17
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 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

@ginsuma
Copy link
Contributor

ginsuma commented Jul 17, 2023

Proposal

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

Room settings authorization.

What is the root cause of that problem?

We don't check user permission when accessing room settings and its menu (room name, who can post, welcome message) via deeplink.

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

  • ReportSettingsPage: we need to change shouldShow condition in FullPageNotFoundView. Currently, the condition is only whether it is empty or not. We should add the condition like below to avoid adding '/settings' after a report url such as DM chats, Concierge, Tasks and having access to settings. This is the condition to show Settings menu in ReportDetailsPage.
    if (isPolicyExpenseChat || isChatRoom || isThread) {
  • RoomNamePage (should be fixed from #21498), WriteCapabilityPage, ReportWelcomeMessagePage: we wrap them in FullPageNotFoundView and reuse the logic in RoomSettingPage to set shouldShow.

What alternative solutions did you explore? (Optional)

Currenty, I don't see anywhere to set notification preference for DM chats. If we need it in the future, we will show only notification item when navigating to DM chats settings.

@alexxxwork
Copy link
Contributor

Proposal

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

What is the root cause of that problem?

The root cause is that we strip first letter of chat report name for all chats (rooms and ordinary chats) here:

App/src/libs/ReportUtils.js

Lines 1207 to 1210 in 67bac9d

if (getChatType(report) === CONST.REPORT.CHAT_TYPE.DOMAIN_ALL) {
// The domainAll rooms are just #domainName, so we ignore the prefix '#' to get the domainName
return report.reportName.substring(1);
}

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

We can add a condition to check whether the first letter is "#" or not

What alternative solutions did you explore? (Optional)

@samh-nl
Copy link
Contributor

samh-nl commented Jul 17, 2023

Proposal

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

The first character of the name is removed in the Room name input.

What is the root cause of that problem?

In the TextInput component, the first character is stripped as it is assumed to be a room having a hashtag:

value={this.props.value.substring(1)} // Since the room name always starts with a prefix, we omit the first character to avoid displaying it twice.

However, this is not the case since it concerns a chat report. No check is currently in place to distinguish these situations.

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

Option 1. Based on an empty value of report.chatType we can determine that this is not a room. In such situation, we should not strip the first character of the name.

Option 2. We should not be able to edit the "room name" in the first place, since it does not concern a room. Thus, in the Settings page, the Room name should be removed, renamed (for example: Chat name, with the name being the actual title, i.e. the participants) and/or made not clickable.

What alternative solutions did you explore? (Option)

N/A

@CortneyOfstad
Copy link
Contributor

Was able to recreate so going to get eyes on this:

Screenshot 2023-07-17 at 10 31 45 AM

@CortneyOfstad CortneyOfstad added the External Added to denote the issue can be worked on by a contributor label Jul 17, 2023
@melvin-bot melvin-bot bot changed the title Web - The first letter of the chat name is cut [$1000] Web - The first letter of the chat name is cut Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

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

melvin-bot bot commented Jul 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@CortneyOfstad
Copy link
Contributor

@robertKozik We have a couple of proposals already shared above — feel free to share your thoughts/comments/etc when you can 👍

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

📣 @med-lean! 📣
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
Copy link

melvin-bot bot commented Jul 17, 2023

📣 @makiour! 📣
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>

@makiour
Copy link
Contributor

makiour commented Jul 17, 2023

Contributor details
Your Expensify account email: m.akiour@aui.ma
Upwork Profile Link: https://www.upwork.com/freelancers/~0120be4cc910d2909e

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@robertKozik
Copy link
Contributor

@CortneyOfstad Sure thing, I'll try review existing proposals today

Hi @makiour It's good to have you here, this issue doesn't have any proposal selected yet, so fell free to post your proposal as well.

@makiour
Copy link
Contributor

makiour commented Jul 17, 2023

Thank you @robertKozik, I will put my proposal in a bit! Thanks for your interaction.

@makiour
Copy link
Contributor

makiour commented Jul 17, 2023

Proposal

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

When we try to check the settings page, and room name more specifically, we ran into cutting the first letter as you can see from the picture I provided:
image

After testing it on my own account, it seems that it happens only at first time when we have a default value of Chat Report.

What is the root cause of that problem?

The root issue is coming from the first time we initiate creating a chat with a user. Mainly, if we check the network request with the onyxData, we can clearly see that once we change the room-name, the data is returned with a dash as you can see below:
image

The issue happens exactly when we just create an account (having that first chat with concierge) or when initiating a chat with any other user. As you can see the response is different and it is static to "Chat Report" without including a #dash.
image

Thus, the issue doesn't have to go with changing the logic of deleting the first letter as we are guaranteed that the room name includes a dash once it is changed as the validation and custom creation forces including the dash

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

The change I suggest:
Rather than modifying all the code blocks where we eliminate the first letter, which will impact the different types of chats and already stored report names, the simplest solution is to change the static name to include "#chat-report" since the beginning and causing everything to show as requested.
When changing this line of code to "#chat-report", it will first comply to the validation (having no uppercase, numbers, etc.) )

DEFAULT_REPORT_NAME: 'Chat Report',

Thus, we will be able to see the full name of the room when creating any chat with any user.
image

What alternative solutions did you explore? (Optional)

The alternative solution is to change the logic of eliminating the first letter, which will need to check if the input includes a dash and differentiating between the two cases. Also, if this solution is the one followed, we need also to keep it in mind whenever a room name convention has changed or when dealing with dashes. Still, this will also fix the issue!

@robertKozik
Copy link
Contributor

Thank you all for your proposals. I'll address each individually:

@ginsuma - I appreciate your proposal the most as it addresses the issue with accessing the settings page. However, it does prevent accessing the settings page for policy expense chats, even though it can be accessed in the "normal" way, to ensure consistency between accessing the settings page from the app and from the deep link. Please consider if wrapping them in FullPageNotFoundView is the best solution. If you can address the problem with policy expense chats, it would be a strong contender.

@alexxxwork - While your proposal should work fine, I believe it doesn't address the root cause of the problem. Trimming the first letter of the name is a workaround for accessing a screen that shouldn't be accessible for a particular chat.

@samh-nl - The second option in your proposal is moving in the right direction as the room name changing page shouldn't be accessible for every type of chat. However, I don't think changing the trimming itself is necessary. If you could expand the second option to the proposal, it'll be taken under consideration

@makiour - I don't think you correctly addressed the root of the problem since it doesn't only occur the first time the chat name value is default. The ability to change the room name should be limited for specific chats. Trimming works fine when it's applicable (when the screen can be accessed by clicking within the app).

To summarize, most of the proposals focus on patching the trimming mechanism rather than addressing the root cause of the problem. We should concentrate on prohibiting access to the screen via the deep link, ensuring consistency with what can be accessed from within the app. @ginsuma's proposal is a strong contender if it can also handle the issue with policy expense chats, which his proposal introduces.

@makiour
Copy link
Contributor

makiour commented Jul 18, 2023

Thank you for your comment @robertKozik

Could you please mention any other cases when this happens as well? As the room name has a validation structure, it seems that we can never save without the dash whenever room it is changed. No matter if we limit changing room name or not, the trimming will always be fine. So the default value is the only one that serms to cause the issue. @alexxxwork, thank you for your like to the comment as well! Do you have anything to add here as I am unable to see another issue with room-name rather than that or the solution looks fine to you.

Thank you so much Robert for your time and comment once again. Happy to take this discussion further.

@robertKozik
Copy link
Contributor

I understand your point, @makiour. Let me provide an example to illustrate the issue. In the case of a normal chat with one person, when you deep link to the settings page, it isn't aware of this type of chat and presents the user with the option to change the name, even though settings shouldn't be accessible. On the other hand, in a thread where the settings page is accessible by clicking within the app, deep linking won't cause this issue because the settings page handles the thread and doesn't present the option to change the name.

These examples demonstrate that the problem lies in the settings page not properly handling all types of chats, rather than the trimming itself. Changing the name works fine for group chats, and patching the name trimming would be over-engineering in this case, as it's not a supported option for threads or normal chats.

Considering these points, I would agree with the approach of fixing the trimming when the changing name field can be accessed through the normal flow of the app, but i think it's not.

@ginsuma
Copy link
Contributor

ginsuma commented Jul 18, 2023

Proposals

Update
cc: @robertKozik

@robertKozik
Copy link
Contributor

Thanks @ginsuma for updating your proposal.

Your proposal effectively addresses the root cause of the issue (also as first one states it correctly) by preventing deep linking to the settings page for chats where it shouldn't be accessible. I also like the idea of expand these checks to other settings pages too.

Due to these reasons, I'd go with @ginsuma proposal

🎀 👀 🎀 C+ reviewed

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

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

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:

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

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 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:

  • [@robertKozik] The PR that introduced the bug has been identified. Link to the PR:
  • [@robertKozik] 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:
  • [@robertKozik] 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:
  • [@robertKozik] Determine if we should create a regression test for this bug.
  • [@robertKozik] 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.
  • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 26, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-08-01] [$1000] Web - The first letter of the chat name is cut [HOLD for payment 2023-08-02] [HOLD for payment 2023-08-01] [$1000] Web - The first letter of the chat name is cut Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.45-7 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 2023-08-02. 🎊

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:

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

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 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:

  • [@robertKozik] The PR that introduced the bug has been identified. Link to the PR:
  • [@robertKozik] 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:
  • [@robertKozik] 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:
  • [@robertKozik] Determine if we should create a regression test for this bug.
  • [@robertKozik] 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.
  • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@CortneyOfstad
Copy link
Contributor

@robertKozik just bumping the check list above ^^ TIA!

@robertKozik
Copy link
Contributor

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:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 31, 2023
@CortneyOfstad
Copy link
Contributor

I'm heading OoO until 8/14 and since this requires payment tomorrow, so reassigning in the meantime.

@alexxxwork — contract has been offered for reporting the issue
@ginsuma — has a contract already in place in Upwork; however, looking through the GH it shows that the assignment took place on July 18, PR was proposed on July 20, but there was a regression. Not sure if this qualifies for the bonus. Thoughts @arosiclair / @robertKozik?

@CortneyOfstad CortneyOfstad removed their assignment Aug 1, 2023
@CortneyOfstad CortneyOfstad added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 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

@CortneyOfstad CortneyOfstad self-assigned this Aug 1, 2023
@arosiclair
Copy link
Contributor

Not sure if this qualifies for the bonus. Thoughts @arosiclair / @robertKozik?

I guess the regression nullifies the bonus, but it might be worth asking in #bug-zero since I haven't seen this kind of thing happen before

@garrettmknight
Copy link
Contributor

I'd agree that the regression nullifies the bonus. We want to reward quick, thorough work.

Paying out now!

@garrettmknight
Copy link
Contributor

garrettmknight commented Aug 3, 2023

Summarizing payouts for this issue:

Issue reporter: @alexxxwork $250 paid via Upwork
Contributor: @ginsuma $1000 paid via Upwork

Upwork job here.

@robertKozik
Copy link
Contributor

Hey, want to just point out that I'm part of the external agency (Software Mansion) so I'm not eligible for payment

@garrettmknight
Copy link
Contributor

Ah, nevermind then. Thanks for the heads up!

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