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 Miro][HOLD for payment 2023-07-28] [$1000] Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings #21961

Closed
1 of 6 tasks
kbecciv opened this issue Jun 30, 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. External Added to denote the issue can be worked on by a contributor Monthly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jun 30, 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:

Prerequisites:

  • one of the default workspace rooms (#announce / #admins) needs to have a thread to reproduce
  1. Login as user A
  2. Click on account’s avatar on LHN to view account setting
  3. Select Workspaces
  4. Click on a workspace to view details
  5. Click on More menu (three dots icon on the top right corner)
  6. Select “Go to #admins room” or “Go to #announces” room

Expected Result:

User should be taken to the #admins or #announce room

Actual Result:

If the room contains a thread, the user is navigated to the threadReport in the room.

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.33-4
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

Go-to-room-issue.mov.mov

Expensify/Expensify Issue URL:
Issue reported by: @tranvantoan-qn
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688019228481189

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01916b494f3ed66140
  • Upwork Job ID: 1675847212932358144
  • Last Price Increase: 2023-07-10
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 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

@samh-nl
Copy link
Contributor

samh-nl commented Jun 30, 2023

The attached video relates to a different issue.

@tranvantoan-qn
Copy link

tranvantoan-qn commented Jun 30, 2023

@samh-nl Thank you for pointing that out
Please check the following video:

Go-to-room-issue.mov.mov

@tranvantoan-qn
Copy link

The issue still persists with 2 of my 3 workspaces, If someone is having trouble reproducing it, please pm me, so I will share my secondary login. It will help you investigate the issue easier!

@StevenKKC
Copy link
Contributor

StevenKKC commented Jul 1, 2023

Proposal

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

In workspace information, user is taken to sub-sub thread/replies when clicking on “Go to #admins room” or "Go to #announce room".

What is the root cause of that problem?

If user click on “Go to #admins room” or "Go to #announce room", goToRoom is called.

const goToRoom = useCallback(
(type) => {
const room = _.find(props.reports, (report) => report && report.policyID === policy.id && report.chatType === type);
Navigation.navigate(ROUTES.getReportRoute(room.reportID));
},
[props.reports, policy],
);

If a user creates a thread on the workspace, the thread has a CONST.REPORT.CHAT_TYPE.POLICY_ADMINS chatType, and policyID is equal to workspace's policyID.
So the thread is selected, and user is taken to the thread.

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

We should select correct workspace room in goToRoom.
Workspace's admin or announce room have null parentReportID and parentReportActionID, and thread have non-null ID.
We should check parentReportID and parentReportActionID in this line.

What alternative solutions did you explore? (Optional)

None.

@melvin-bot
Copy link

melvin-bot bot commented Jul 1, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@melvin-bot melvin-bot bot added the Overdue label Jul 3, 2023
@trjExpensify trjExpensify changed the title Web - In workspace information, user is taken to sub-sub thread/replies when clicking on “Go to #admins” or #announces room Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings Jul 3, 2023
@trjExpensify
Copy link
Contributor

The video in the OP is not related to this bug btw, switching it out for one from the slack thread.

I can reproduce this one. The prerequisite is that the default room contains a threadReport, so I've also updated the OP to reflect that:

Y7OMAWq13U.mp4

@melvin-bot melvin-bot bot removed the Overdue label Jul 3, 2023
@trjExpensify trjExpensify added Overdue External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed Overdue labels Jul 3, 2023
@melvin-bot melvin-bot bot changed the title Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings [$1000] Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings Jul 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01916b494f3ed66140

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

melvin-bot bot commented Jul 3, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jul 5, 2023
@trjExpensify
Copy link
Contributor

@0xmiroslav - what do you think of this proposal?

@melvin-bot melvin-bot bot removed the Overdue label Jul 5, 2023
@Nodebrute
Copy link
Contributor

Nodebrute commented Jul 9, 2023

Proposal

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

Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings

What is the root cause of that problem?

When we are calling goToRoom there is no check to verify if it's workspace thread. Workspace Threads will also have the same chat type as their parent room.

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

Solution 1

we have a utility function

function isWorkspaceThread(report) {

We can use it to verify if it's !isWorkspaceThread
change goToRoom From this

const room = _.find(props.reports, (report) => report && report.policyID === policy.id && report.chatType === type);

to this

const room = _.find(props.reports, (report) => report && report.policyID === policy.id && report.chatType === type && !ReportUtils.isWorkspaceThread(report));

Don't forget to export the function. Currently, we are using this function inside the ReportUtils, which is why it has not been exported yet.
Solution 2
We have other utility functions
isDefaultRoom
isAnnounceRoom
isAdminRoom

Currently all of them will return true if it's a workspace thread because Workspace Threads will also have the same chat type as their parent room. We can fix them and use isDefaultRoom to check if it's a default room.

What alternative solutions did you explore? (Optional)

We can simply use isThread utility function to check if it's the thread

@melvin-bot melvin-bot bot added the Overdue label Jul 9, 2023
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Jul 21, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings [HOLD for payment 2023-07-28] [$1000] Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings Jul 21, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 21, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 21, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.43-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-07-28. 🎊

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:

  • @0xmiroslav requires payment
  • @StevenKKC requires payment

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 21, 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:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] 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.
  • [@trjExpensify] 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 Monthly KSv2 and removed Weekly KSv2 labels Jul 27, 2023
@trjExpensify trjExpensify removed the Monthly KSv2 label Jul 28, 2023
@trjExpensify
Copy link
Contributor

👋 @0xmiroslav can you get to the checklist please? :)

@0xmiros
Copy link
Contributor

0xmiros commented Jul 28, 2023

  • The PR that introduced the bug has been identified. Link to the PR: Added go to room menu items to workspace #19295
  • 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: https://github.com/Expensify/App/pull/19295/files#r1277591208
  • 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
  • Determine if we should create a regression test for this bug.
  • 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.

Regression Test Proposal

  1. Send any message in #admins or #announce room in any workspace
  2. Reply that message in thread
  3. Go to Settings > Workspaces > that workspace
  4. Click 3 dots menu on top right corner and go to #admins or #announce room
  5. Verify that is taken to correct #admins or #announce room, not thread

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@trjExpensify
Copy link
Contributor

Thanks! Looks like Applause added a test case for this on July 3rd (link you won't be able to access), so we should be good there!

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2023
@trjExpensify
Copy link
Contributor

Proceeding with the payments due. I have those calculated as follows:

@tranvantoan-qn - $250 for the bug report (offer sent)
@StevenKKC - $1,500 for the fix & #urgency bonus (paid!)
@0xmiroslav - $1,500 for C+ review & #urgency bonus (offer sent)

@trjExpensify
Copy link
Contributor

@tranvantoan-qn paid!

@0xmiros
Copy link
Contributor

0xmiros commented Jul 31, 2023

@trjExpensify can you please hold my payment until further notice? I am working on some stuff due to recent measurements in my region. And update issue to Monthly. Thanks

@trjExpensify
Copy link
Contributor

Sure thing!

@trjExpensify trjExpensify added Weekly KSv2 Monthly KSv2 and removed Daily KSv2 Weekly KSv2 labels Aug 1, 2023
@trjExpensify trjExpensify changed the title [HOLD for payment 2023-07-28] [$1000] Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings [Hold for Miro][HOLD for payment 2023-07-28] [$1000] Web - user is navigated to thread when clicking on “Go to #admins” or "Go to #announce room" in the workspace settings Aug 1, 2023
@trjExpensify
Copy link
Contributor

@0xmiroslav what's the deal here now to issue payment?

@0xmiros
Copy link
Contributor

0xmiros commented Aug 30, 2023

Still in discussion. Waiting for confirmation in email thread

@trjExpensify
Copy link
Contributor

Okay, sounds good. Let me know here once resolved!

@trjExpensify
Copy link
Contributor

@0xmiroslav, I'm going to close these!

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. External Added to denote the issue can be worked on by a contributor Monthly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants