Skip to content

[Due for payment 2025-02-19] [$250] Debug - Rooms that deny access to post are listed in list of contacts to share log data #55012

Closed

Description

@vincdargento

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: v9.0.82-4
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Windows 11/ Chrome, Android 13/ Chrome, Tecno Spark 20/ Android 13
App Component: User Settings

Action Performed:

Pre-condition: Be a member of a workspace with more than 2 members

  1. Sign in to NewDot
  2. Navigate to Account settings > Troubleshoot
  3. Enable client side logging
  4. Navigate to view client side logging
  5. Click on share

Expected Result:

List of accounts and workspace that the user can send messages to are shown.

Actual Result:

Rooms that the user cannot send messages to like #announce room of another workspace are included in the list of accounts to share to.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021884015946368018307
  • Upwork Job ID: 1884015946368018307
  • Last Price Increase: 2025-02-03
Issue OwnerCurrent Issue Owner: @strepanier03

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 9, 2025
  2. melvin-bot commented on Jan 9, 2025

    @melvin-bot

    Triggered auto assignment to @strepanier03 (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. bernhardoj commented on Jan 9, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Announce room is shown on the share log list even though it's not writable.

    What is the root cause of that problem?

    Currently, we don't have any filter to filter out read-only report.

    const shareLogOptions = OptionsListUtils.getShareLogOptions(options, betas ?? []);

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

    We need to add a new option to getValidOptions whether to filter out read-only report or not. We pass it as true from getShareLogOptions. In getValidOptions, we filter it out using the condition from the ReportFooter.

    const canPerformWriteAction = ReportUtils.canUserPerformWriteAction(report) ?? shouldShowComposerOptimistically;
    const shouldHideComposer = !canPerformWriteAction || isBlockedFromChat;

    const allReportOptions = filteredReportOptions.filter((option) => {
    const report = option.item;
    if (!report) {
    return false;
    }
    const isThread = option.isThread;
    const isTaskReport = option.isTaskReport;
    const isPolicyExpenseChat = option.isPolicyExpenseChat;
    const isMoneyRequestReport = option.isMoneyRequestReport;
    const isSelfDM = option.isSelfDM;
    const isChatRoom = option.isChatRoom;
    const accountIDs = ReportUtils.getParticipantsAccountIDsForDisplay(report);
    if (isPolicyExpenseChat && report.isOwnPolicyExpenseChat && !includeOwnedWorkspaceChats) {
    return false;
    }

    if (!includeReadOnlyReport && !ReportUtils.canUserPerformWriteAction(report) ....) {
        return false;
    }
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We need to test getShareLogOptions that it correctly filter out any read-only report (dummy list)

  4. huult commented on Jan 9, 2025

    @huult
    Contributor

    Edited by proposal-police: This proposal was edited at 2025-01-09 17:00:39 UTC.

    Proposal

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

    Rooms that deny access to post are listed in list of contacts to share log data

    What is the root cause of that problem?

    We do not filter valid options for the share log list.

    const defaultOptions = useMemo(() => {

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

    To resolve this issue, we should add a new condition to check if isReservedRoomName is true, then filter out the option list.

    shouldBoldTitleByDefault = true,

    add

      isReservedRoomName = false
      isArchivedRoom = false

    add:

        if (isReservedRoomName && ValidationUtils.isReservedRoomName(option.text)) {
            return false;
        }
        if (isArchivedRoom && ReportUtils.isArchivedRoom(option)) {
            return false;
        }
        ...

    function getShareLogOptions(options: OptionList, betas: Beta[] = []): Options {

    update to:

      function getShareLogOptions(options: OptionList, betas: Beta[] = []): Options {
          return getValidOptions(options, {
              betas,
              includeMultipleParticipantReports: true,
              includeP2P: true,
              forcePolicyNamePreview: true,
              includeOwnedWorkspaceChats: true,
              includeSelfDM: true,
              includeThreads: true,
              isReservedRoomName: true, // add this line
              isArchivedRoom: true, // add this line
          });
      }

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We need to test if getShareLogOptions data does not include isReservedRoomName and isArchivedRoom.

    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.

  5. melvin-bot commented on Jan 13, 2025

    @melvin-bot

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

  6. melvin-bot commented on Jan 15, 2025

    @melvin-bot

    @strepanier03 Eep! 4 days overdue now. Issues have feelings too...

  7. melvin-bot commented on Jan 17, 2025

    @melvin-bot

    @strepanier03 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  8. strepanier03 commented on Jan 18, 2025

    @strepanier03
    Contributor

    Working on testing this but need to make a new test account because my current ones have too many workspaces so it's hard to tell which in the list I shouldn't have access too.

  9. melvin-bot commented on Jan 21, 2025

    @melvin-bot

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

  10. melvin-bot commented on Jan 23, 2025

    @melvin-bot

    @strepanier03 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  11. 58 remaining items

  12. parasharrajat commented on Feb 18, 2025

    @parasharrajat
    Member

    Payment requested

  13. bernhardoj commented on Feb 18, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  14. luacmartins commented on Feb 18, 2025

    @luacmartins
    Contributor

    Seems like we're good to close this one?

  15. parasharrajat commented on Feb 18, 2025

    @parasharrajat
    Member

    We need a payment summary cc: @strepanier03

  16. melvin-bot commented on Feb 19, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@strepanier03)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1884015946368018307/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  17. strepanier03 commented on Feb 19, 2025

    @strepanier03
    Contributor

    Today is the payment release date so I am taking care of this now.

  18. strepanier03 commented on Feb 19, 2025

    @strepanier03
    Contributor

    I made the reg test request.

  19. strepanier03 commented on Feb 19, 2025

    @strepanier03
    Contributor

    Payment Summary

  20. strepanier03 commented on Feb 19, 2025

    @strepanier03
    Contributor

    Payment summary here, I'm closing now.

  21. JmillsExpensify commented on Feb 20, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  22. JmillsExpensify commented on Feb 21, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @parasharrajat

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