Skip to content

[Due for payment 2025-03-05] [$250] Room - #announce room can be created via room mention #50173

Closed

Description

@IuliiaHerets

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: 9.0.44-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+pso@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new workspace.
  3. Go to FAB > Start chat > Room.
  4. Enter #announce as room name and save it.
  5. Note that it shows error that the room name cannot be #announce.
  6. Go to workspace chat.
  7. Send message containing #announce mention.
  8. Click Yes from the whisper to create the room.
  9. Note that #announce room can be created via mention.
  10. Invite 3 members to the workspace.
  11. Note that now there are two #announce rooms.

Expected Result:

In Step 8, app should prevent #announce room from being created via room mention.

Actual Result:

In Step 8. #announce room can be via room mention.
In Step 11, after inviting 3 members to the workspace, it results in two #announce rooms.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6623434_1727973755589.20241004_003551.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021845791038434812550
  • Upwork Job ID: 1845791038434812550
  • Last Price Increase: 2024-10-28
  • Automatic offers:
    • allgandalf | Reviewer | 104651165
    • mkzie2 | Contributor | 104651168
Issue OwnerCurrent Issue Owner: @allgandalf

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 3, 2024
  2. melvin-bot commented on Oct 3, 2024

    @melvin-bot

    Triggered auto assignment to @sonialiap (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.

  3. IuliiaHerets commented on Oct 3, 2024

    @IuliiaHerets
    Author

    @sonialiap FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. Nodebrute commented on Oct 3, 2024

    @Nodebrute
    Contributor

    Proposal

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

    #announce room can be created via room mention

    What is the root cause of that problem?

    We are adding #announce in reserved names

    App/src/CONST.ts

    Line 1011 in 96aceca

    RESERVED_ROOM_NAMES: ['#admins', '#announce'],

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

    We can remove #announce from here

    App/src/CONST.ts

    Line 1011 in 96aceca

    RESERVED_ROOM_NAMES: ['#admins', '#announce'],

    We should also cleanup in other places where we are using #announce

    What alternative solutions did you explore? (Optional)

  5. mkzie2 commented on Oct 4, 2024

    @mkzie2
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-10-14 21:42:57 UTC.

    Proposal

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

    In Step 8. #announce room can be via room mention.
    In Step 11, after inviting 3 members to the workspace, it results in two #announce rooms.

    What is the root cause of that problem?

    • The policyAnnounce is just created if the policy has 3 or more members. This is handled in PR.

    • In this bug, when policyAnnounce is not created, then we send a message with room mention #announce, BE returns the actionable whisper, that is incorrect.

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

    • First, BE should not return actionable whisper message when user send #announce message.

    • Then, we need to modify the error message when creating a new room as well as when editing a room name. When user try creating a room with "announce" as name:

    1. If the policyAnnounce room has not been created yet, should show "This name is reserved for future use. Please choose a different name"

    2. If the policyAnnounce room has been, should show "A room with this name already exists" or "Announce is a default room on all workspaces. Please choose another name."

    • Below is the code changes:
    1. Introduce a function to check whether the policy has policyAnnounce or not:
    function hasAnnounceRoom(reports: OnyxCollection<Report>, policyID: string): boolean {
        return Object.values(reports ?? {}).some((report) => report && report.policyID === policyID && isAnnounceRoom(report));
    }
    
    1. Update the validation:

    } else if (ValidationUtils.isReservedRoomName(values.roomName)) {

                } else if (values.roomName === '#announce') {
                    if (!ValidationUtils.hasAnnounceRoom(reports, values.policyID ?? '-1')) {
                        ErrorUtils.addErrorMessage(errors, 'roomName', 'This name is reserved for future use. Please choose a different name');
                    } else {
                        ErrorUtils.addErrorMessage(errors, 'roomName', translate('newRoomPage.roomAlreadyExistsError'));
                    }
                } else if (ValidationUtils.isReservedRoomName(values.roomName)) {
    
    • The similar fix should be applied to:

    } else if (ValidationUtils.isReservedRoomName(values.roomName)) {

    What alternative solutions did you explore? (Optional)

    • First, BE should not return actionable whisper message when user send #announce message.

    • Then update the validation:

    } else if (ValidationUtils.isReservedRoomName(values.roomName)) {

                } else if (values.roomName === '#announce') {
                    ErrorUtils.addErrorMessage(errors, 'roomName', 'The name #announce is a default room title and cannot be used in a new name, please select a new name');
                } else if (ValidationUtils.isReservedRoomName(values.roomName)) {
    
    • The similar fix should be applied to:

    } else if (ValidationUtils.isReservedRoomName(values.roomName)) {

  6. mkzie2 commented on Oct 4, 2024

    @mkzie2
    Contributor

    We only create a workspace when 3 or more participants are added. So, should we update the error message for creating a new room? When a user tries to create a room named 'announce,' my suggestion is:

    1. If the policyAnnounce room has not been created yet, should show "This name is reserved for future use. Please choose a different name" - This message informs the user that the room doesn't exist yet but could be created in the future.

    2. If the policyAnnounce room has been, should show "A room with this name already exists" or "Announce is a default room on all workspaces. Please choose another name." - This clarifies that the room is already created."

    What do you think? @Expensify/design @sonialiap

  7. sonialiap commented on Oct 8, 2024

    @sonialiap
    Contributor

    @IuliiaHerets can you please test this and confirm the URL of the new announce room you seem to be creating with the mention? I my test the mention links to the workspace announce room, so no new room is being created. I can't repo

    Screen.Recording.2024-10-08.at.4.30.24.PM.mov
  8. MelvinBot commented on Oct 8, 2024

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  9. IuliiaHerets commented on Oct 10, 2024

    @IuliiaHerets
    Author

    @sonialiap QA team can repro this issue. The link from both rooms are different. Also, there are two #announce in LHN

    20241010_082743.mp4
  10. 162 remaining items

  11. melvin-bot commented on Feb 26, 2025

    @melvin-bot

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

  12. melvin-bot commented on Feb 26, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.6-1 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 2025-03-05. 🎊

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

  13. melvin-bot commented on Feb 26, 2025

    @melvin-bot

    @allgandalf @sonialiap @allgandalf 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]

  14. sonialiap commented on Mar 5, 2025

    @sonialiap
    Contributor

    Payment summary:

  15. allgandalf commented on Mar 7, 2025

    @allgandalf
    Contributor

    I will complete the checklist tomorrow

  16. allgandalf commented on Mar 9, 2025

    @allgandalf
    Contributor

    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 (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 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: N/A this was the way it was from the start

    • [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: N/A

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

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:https://github.com/Expensify/Expensify/issues/479316

    Regression Test Proposal

    Precondition:

    • N/A

    Test:

    1. Pick a workspace that does not have #announce room
    2. Go to that workspace chat
    3. Send #announce to the workspace chat
      Verify the room mention does NOT highlight
      Verify an actionable whisper Heads up, announce room doesn't exist. Do you want to create it? does NOT appear
    4. Send a room mention that does NOT exist (#test-room for example; should NOT be a reserved room name like #admins or #announce)
      Verify the room mention does NOT highlight
      Verify an actionable whisper Heads up, announce room doesn't exist. Do you want to create it? appears
    5. Click Yes
      Verify that room is created
      Verify the room mention highlights
    6. Click the room mention
      Verify app opens the room chat
    7. Repeat steps 4 - 6 with another non-existent room mention
    8. Click No
      Verify the room mention does NOT highlight & the room is NOT created
    9. Send a room mention that already exists
      10 Click the room mention
      Verify app opens the room chat

    Do we agree 👍 or 👎

  17. allgandalf commented on Mar 10, 2025

    @allgandalf
    Contributor

    bump for payment @sonialiap

  18. sonialiap commented on Mar 11, 2025

    @sonialiap
    Contributor

    Thanks @allgandalf for the checklist! Payment made

  19. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions