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

[$500] Public room can't be seen on LHN after opening it from a link #30615

Closed
5 of 6 tasks
lanitochka17 opened this issue Oct 30, 2023 · 28 comments
Closed
5 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 30, 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: 1.3.93-0
**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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal team
Slack conversation:

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log out
  3. Navigate to this link - https://staging.new.expensify.com/r/3504895439653267
  4. Log in with any accounts

Expected Result:

The public room should be displayed

Actual Result:

The public room can't be seen on LHN

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
Window: Chrome

Bug6257319_1698697773901!Screenshot_602

MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010cd18e947fb2a8d5
  • Upwork Job ID: 1719138151952470016
  • Last Price Increase: 2023-10-30
  • Automatic offers:
    • dukenv0307 | Contributor | 27493079
@lanitochka17 lanitochka17 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 30, 2023
@melvin-bot melvin-bot bot changed the title Public room can't be seen on LHN after opening it from a link [$500] Public room can't be seen on LHN after opening it from a link Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

Job added to Upwork: https://www.upwork.com/jobs/~010cd18e947fb2a8d5

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

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

melvin-bot bot commented Oct 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

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@erquhart
Copy link
Contributor

erquhart commented Oct 31, 2023

Proposal

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

If the current chat is a public room, it should show in the left hand nav.

What is the root cause of that problem?

Public rooms were removed from the left hand nav in a recent PR:
https://github.com/Expensify/App/pull/27966/files#diff-65c096044d5f69b35bcdec14c99c4fda4580759df9b1a7c36650d58eea276f1d

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

Revert to fix (tested locally, works).

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@jliexpensify
Copy link
Contributor

Hmm I'm unable to repro on Staging v1.3.93-0 (Chrome) - LHN is there for me:

image

@erquhart
Copy link
Contributor

@jliexpensify left hand nav is there, but the public channel currently being viewed isn’t in the list.

@jliexpensify
Copy link
Contributor

Ah sorry, my mistake - thanks @erquhart!

@dukenv0307
Copy link
Contributor

Proposal

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

Public room can't be seen on LHN after opening it from a link

What is the root cause of that problem?

BE returns participantAccountIDs as an empty array for this public room

Screenshot 2023-10-31 at 16 18 25

And then this report is excluded in LHN by this condition

App/src/libs/ReportUtils.js

Lines 3278 to 3282 in deb267f

report.participantAccountIDs.length === 0 &&
!isChatThread(report) &&
!isUserCreatedPolicyRoom(report) &&
!isArchivedRoom(report) &&
!isMoneyRequestReport(report) &&

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

  1. We can fix this issue in BE. We should return correctly participantAccountIDs of the public room.

  2. If it's expected behavior to return participantAccountIDs as empty for some special public room, we can add the check for public room here to not exclude the public room if the participantAccountIDs is empty

report.participantAccountIDs.length === 0 &&
!isChatThread(report) &&
!isPublicRoom(report) &&
!isUserCreatedPolicyRoom(report) &&
!isArchivedRoom(report) &&
!isMoneyRequestReport(report) &&
!isTaskReport(report))

App/src/libs/ReportUtils.js

Lines 3278 to 3282 in deb267f

report.participantAccountIDs.length === 0 &&
!isChatThread(report) &&
!isUserCreatedPolicyRoom(report) &&
!isArchivedRoom(report) &&
!isMoneyRequestReport(report) &&

What alternative solutions did you explore? (Optional)

@thesahindia
Copy link
Member

Asked @jasperhuangg for their opinion.

@jasperhuangg
Copy link
Contributor

@thesahindia I can't seem to find your comment, do you mind linking it again?

@jasperhuangg
Copy link
Contributor

So it's actually expected that the participantAccountIDs are empty if you're not a member of the workspace that the public room is a part of.

This is because of privacy concerns. So no BE fixes are needed here.

@jasperhuangg
Copy link
Contributor

jasperhuangg commented Nov 1, 2023

We just need to update the condition here to be the following. I forgot to take into account public announce rooms in my PR.

report.participantAccountIDs.length === 0 && 
 !isChatThread(report) && 
 !isUserCreatedPolicyRoom(report) && 
 !isPublicRoom(report) && 
 !isArchivedRoom(report) && 
 !isMoneyRequestReport(report) && 

I think @erquhart's proposal was the closest to this (but we definitely shouldn't be reverting that entire PR). If you're willing to get another proposal up explaining why this works then I'd be happy to accept it.

@erquhart
Copy link
Contributor

erquhart commented Nov 1, 2023

@jasperhuangg that's what my existing proposal is, I just didn't check to see what else that PR had. When I say to revert, I only meant reverting the exclusion of the isPublicRoom() condition. I'll go ahead and make an updated proposal.

@erquhart
Copy link
Contributor

erquhart commented Nov 1, 2023

Proposal

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

Public rooms opened via link aren't showing in the left hand nav.

What is the root cause of that problem?

Reports with a visibility property matching PUBLIC or PUBLIC_ANNOUNCE used to be included in the left hand nav via isPublicRoom():

App/src/libs/ReportUtils.js

Lines 411 to 413 in 1700ecf

function isPublicRoom(report) {
return report && (report.visibility === CONST.REPORT.VISIBILITY.PUBLIC || report.visibility === CONST.REPORT.VISIBILITY.PUBLIC_ANNOUNCE);
}

This was removed with - based on the PR conversation from #27966 - the understanding that public rooms were expected to be included in isUserCreatedPolicyRoom(), but that function only includes reports with a POLICY_ROOM chat type. isPublicRoom() is still needed to match report visibility against PUBLIC and PUBLIC_ANNOUNCE types.

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

Re-add the !isPublicRoom(report) statement to this conditional:

App/src/libs/ReportUtils.js

Lines 3277 to 3283 in deb267f

(report.participantAccountIDs &&
report.participantAccountIDs.length === 0 &&
!isChatThread(report) &&
!isUserCreatedPolicyRoom(report) &&
!isArchivedRoom(report) &&
!isMoneyRequestReport(report) &&
!isTaskReport(report))

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@thesahindia
Copy link
Member

2. If it's expected behavior to return participantAccountIDs as empty for some special public room, we can add the check for public room here to not exclude the public room if the participantAccountIDs is empty

report.participantAccountIDs.length === 0 &&
!isChatThread(report) &&
!isPublicRoom(report) &&
!isUserCreatedPolicyRoom(report) &&
!isArchivedRoom(report) &&
!isMoneyRequestReport(report) &&
!isTaskReport(report))

Actually @dukenv0307 suggested two solutions and their second solution was to add !isPublicRoom(report). So I think they should be assigned.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 2, 2023

Triggered auto assignment to @neil-marcellini, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@jasperhuangg
Copy link
Contributor

Got it, since @dukenv0307 had a clearer proposal and was more in line with what I was thinking, let's assign them. cc @neil-marcellini

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

📣 @thesahindia Please request via NewDot manual requests for the Reviewer role ($500)

Copy link

melvin-bot bot commented Nov 2, 2023

📣 @dukenv0307 🎉 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 📖

@neil-marcellini
Copy link
Contributor

neil-marcellini commented Nov 2, 2023

Cool, I agree that the proposal from @dukenv0307 looks good.

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

@thesahindia The PR is ready for review.

@jliexpensify
Copy link
Contributor

Hrrrm what happened with the updater here? It looks like this hit production 2 weeks ago right? If so, I should be paying + the checklist should be worked on, right?

@jliexpensify jliexpensify changed the title [$500] Public room can't be seen on LHN after opening it from a link [NEED TO PAY?][$500] Public room can't be seen on LHN after opening it from a link Nov 21, 2023
@dukenv0307
Copy link
Contributor

Yes, seems like bot not work on this issue.

@jliexpensify
Copy link
Contributor

If we are going off #30814, here's the Payment Summary:

  • Contributor: @dukenv0307 $750 (bonus as it was merged in 3 working days)
  • C+: @thesahindia$750 (bonus as it was merged in 3 working days) - NEW.DOT PAYMENT

Upworks job

is this all correct? @thesahindia could you complete the checklist too?

@jliexpensify
Copy link
Contributor

Paid and job closed. Waiting on checklist to be completed!

@jliexpensify jliexpensify changed the title [NEED TO PAY?][$500] Public room can't be seen on LHN after opening it from a link [WAITING ON CHECKLIST][$500] Public room can't be seen on LHN after opening it from a link Nov 21, 2023
@thesahindia
Copy link
Member

We just need to update the condition here to be the following. I forgot to take into account public announce rooms in my PR.

As mentioned in #30615 (comment), this case wasn't taken into account.

We can add a test case -

  1. Login to user A and create a public room for workspace that doesn't contain user B
  2. Log out and open the public room using the link
  3. Login to account B
  4. Verify the room is visible in the LHN

@jliexpensify jliexpensify changed the title [WAITING ON CHECKLIST][$500] Public room can't be seen on LHN after opening it from a link [$500] Public room can't be seen on LHN after opening it from a link Nov 22, 2023
@JmillsExpensify
Copy link

$750 payment approved for @thesahindia based on this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. 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

8 participants