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-11-27] [$500] Able to set welcome message for threads created from policy room #29454

Closed
6 tasks done
m-natarajan opened this issue Oct 12, 2023 · 33 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

@m-natarajan
Copy link

m-natarajan commented Oct 12, 2023

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


Version Number: v1.3.83-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: @esh-g
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696870060334269

Action Performed:

  1. Go to a policy room like #admins
  2. Send a message in the room.
  3. Create a thread from the message.
  4. Click on the report header.
  5. Click on settings.

Expected Result:

We should not be able to see the welcome message options because that should only be available for policy rooms

Actual Result:

We are able to see the welcome message options because that should only be available for policy rooms

Workaround:

Unknown

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
Screen.Recording.2023-10-12.at.6.05.39.PM.mov
Android: mWeb Chrome
Screen.Recording.2023-10-12.at.6.04.25.PM.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2023-10-12.at.6.02.27.PM.mov
Welcome.msg.mp4
MacOS: Chrome / Safari
Screen.Recording.2023-10-09.at.10.12.53.PM.mov
Welcome.msg.mp4
MacOS: Desktop
Screen.Recording.2023-10-12.at.6.08.42.PM.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fb77409d93dbd64a
  • Upwork Job ID: 1712481255751467008
  • Last Price Increase: 2023-10-26
  • Automatic offers:
    • dukenv0307 | Contributor | 27464013
    • esh-g | Reporter | 27464014
    • situchan | Contributor | 28046076
@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 @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot changed the title Able to set welcome message for threads created from policy room [$500] Able to set welcome message for threads created from policy room Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@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

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
Copy link

melvin-bot bot commented Oct 12, 2023

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

@esh-g
Copy link
Contributor

esh-g commented Oct 12, 2023

Proposal

Re-state the problem

We are able to set welcome message for a thread in a policy room.

What is the root cause of this problem?

There is no check to see if the room is a thread

What changes should be made to fix this?

We should not allow welcome message on threads by adding ReportUtils.isChatThread(report) here:

const shouldDisableWelcomeMessage =
isMoneyRequestReport || ReportUtils.isArchivedRoom(report) || !ReportUtils.isChatRoom(report) || _.isEmpty(linkedWorkspace) || linkedWorkspace.role !== CONST.POLICY.ROLE.ADMIN;

Optional change
Screenshot 2023-10-12 at 8 46 42 PM

Even after removing the welcomeMessage, there is also the visibility which we normally don't show for threads. I don't think threads can be public like rooms, so we can hide them by adding the the !ReportUtils.isChatThread(report) here:

{Boolean(report.visibility) && (

What other alternative did you explore?

We can also add the !isThread(report) condition to ReportUtils.isChatRoom() because I don't think that function means to include threads.

App/src/libs/ReportUtils.js

Lines 395 to 397 in f942acd

function isChatRoom(report) {
return isUserCreatedPolicyRoom(report) || isDefaultRoom(report);
}

@dukenv0307
Copy link
Contributor

dukenv0307 commented Oct 12, 2023

Proposal

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

  1. We are able to see the welcome message options in threads of policy rooms.

  2. They can also access the Welcome message page if accessing from deeplink on the thread plus /welcomeMessage

What is the root cause of that problem?

  1. In this condition, we're not checking if the chat report is a thread

  2. In here, we're showing the full page not found if the chat report is a thread, we only check if the user doesn't have admin permission. This also misses many other conditions as well.

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

  1. Add chat thread check to here
|| ReportUtils.isChatThread(report)
  1. Add chat thread check to here. This should be enough to fix in this issue. But we can add other conditions similar to in here as well for a full fix. We can extract that permission check to a separate util checkShouldDisableWelcomeMessage for reusability.

What alternative solutions did you explore? (Optional)

In part 2, we could redirect the users back to the Report Settings screen instead of not found page, depending on what UX we want.

I remember there's a thread that's discussing the pattern (hook, ...) that we should use to standardize the screen permission check. But whatever pattern is chosen will need the checks as highlighted above.

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

melvin-bot bot commented Oct 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

@ntdiary, @anmurali Huh... This is 4 days overdue. Who can take care of this?

@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? 💸

@ntdiary
Copy link
Contributor

ntdiary commented Oct 19, 2023

Sorry for the delay, I still don't have enough bandwidth to review, have requested help in slack.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

@anmurali
Copy link

Asking here

@situchan
Copy link
Contributor

situchan commented Oct 24, 2023

Volunteering from @anmurali's request

@situchan
Copy link
Contributor

@anmurali can you please assign me to this issue?

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

@anmurali 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
Copy link

melvin-bot bot commented Oct 26, 2023

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

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

@dukenv0307's proposal looks good to me.
Agree to show not found page when deep link to welcome message page. And that should be handled here and covered in proposal.
🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 1, 2023
@dukenv0307
Copy link
Contributor

@situchan The PR is ready for review

@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 20, 2023
@melvin-bot melvin-bot bot changed the title [$500] Able to set welcome message for threads created from policy room [HOLD for payment 2023-11-27] [$500] Able to set welcome message for threads created from policy room Nov 20, 2023
Copy link

melvin-bot bot commented Nov 20, 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 Nov 20, 2023
Copy link

melvin-bot bot commented Nov 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.0-3 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-11-27. 🎊

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 Nov 20, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Nov 27, 2023
@chiragsalian
Copy link
Contributor

Friendly bump to update the checklist above @dukenv0307. Also is anything pending on your end @anmurali?
I'd like to close this out soon if possible 🙂

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 29, 2023
Copy link

melvin-bot bot commented Dec 4, 2023

@anmurali, @chiragsalian, @dukenv0307 Eep! 4 days overdue now. Issues have feelings too...

@situchan
Copy link
Contributor

situchan commented Dec 5, 2023

This is still awaiting payment from @anmurali

@anmurali
Copy link

anmurali commented Dec 6, 2023

@situchan why aren't you one of the assignees? I believe you were the C+ and also need to be paid? I paid the contributor and reporter.

@melvin-bot melvin-bot bot removed the Overdue label Dec 6, 2023
@situchan
Copy link
Contributor

situchan commented Dec 6, 2023

@melvin-bot melvin-bot bot added the Overdue label Dec 8, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

@anmurali, @chiragsalian, @dukenv0307 Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Dec 12, 2023

📣 @situchan 🎉 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 removed the Overdue label Dec 12, 2023
@anmurali
Copy link

@situchan has also been paid. I believe I can close this now.

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