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

[$250] [HOLD for payment 2024-11-28] Having the 'hidden' notification preference" the reports are displayed in LHN and not marked as read by the migration #52396

Closed
1 of 8 tasks
m-natarajan opened this issue Nov 12, 2024 · 22 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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@m-natarajan
Copy link

m-natarajan commented Nov 12, 2024

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:
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @Puneet-here
Slack conversation (hyperlinked to channel name): ts_external_expensify_migrate

Action Performed:

Precondition : Admin has preference set to "focus mode"

  1. Create a workspace
  2. Submit expense report as a employee
  3. Approve and pay the report

Expected Result:

Having the 'hidden' notification preference" the reports are not displayed in LHN and marked as read by the migration

Actual Result:

Having the 'hidden' notification preference" the reports are displayed in LHN and not marked as read by the migration

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

image (17)

{
    "chatReportID": "1137125431319052",
    "chatType": "",
    "currency": "AUD",
    "description": "",
    "errorFields": {},
    "hasOutstandingChildRequest": false,
    "hasOutstandingChildTask": false,
    "hasParentAccess": false,
    "isCancelledIOU": false,
    "isOwnPolicyExpenseChat": false,
    "isPinned": false,
    "isWaitingOnBankAccount": false,
    "lastActionType": "IOU",
    "lastActorAccountID": "8279983",
    "lastMessageHtml": "$6.84 expense",
    "lastMessageText": "$6.84 expense",
    "lastReadSequenceNumber": 0,
    "lastVisibleActionCreated": "2024-11-11 21:46:49.258",
    "lastVisibleActionLastModified": "2024-11-11 21:46:49.258",
    "managerID": 2012843,
    "nonReimbursableTotal": -1573,
    "notificationPreference": "hidden",
    "oldPolicyName": "",
    "ownerAccountID": 8279983,
    "parentReportActionID": "3224493339114563292",
    "parentReportID": "1137125431319052",
    "participants": {
        "778531": {
            "hidden": true,
            "notificationPreference": "hidden"
        },
        "2012843": {
            "hidden": true,
            "notificationPreference": "hidden"
        },
        "8279983": {
            "hidden": true,
            "notificationPreference": "hidden"
        },
        "9645353": {
            "hidden": true,
            "notificationPreference": "hidden"
        },
        "9662119": {
            "hidden": true,
            "notificationPreference": "hidden"
        },
        "9713816": {
            "hidden": true,
            "notificationPreference": "hidden"
        },
        "10903701": {
            "hidden": true,
            "notificationPreference": "hidden"
        }
    },
    "permissions": [
        "read",
        "write"
    ],
    "policyID": "0D00F2B7A62842CD",
    "private_isArchived": "",
    "reportID": "60770197",
    "reportName": "Cheryl Expenses to 2020-05-03",
    "stateNum": 2,
    "statusNum": 3,
    "total": -1573,
    "type": "expense",
    "unheldNonReimbursableTotal": -1573,
    "unheldTotal": -1573,
    "welcomeMessage": "",
    "writeCapability": "all"
}

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @puneetlath / @alexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021861838752564656953
  • Upwork Job ID: 1861838752564656953
  • Last Price Increase: 2024-11-27
Issue OwnerCurrent Issue Owner: @
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Nov 12, 2024
@m-natarajan m-natarajan moved this to First Cohort - CRITICAL in [#whatsnext] #migrate Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

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

@MelvinBot
Copy link

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

@puneetlath puneetlath removed the Needs Reproduction Reproducible steps needed label Nov 13, 2024
@puneetlath
Copy link
Contributor

@ikevin127 is going to help out with this one. Discussing here: https://expensify.slack.com/archives/C02NK2DQWUX/p1731537652304929

@ikevin127
Copy link
Contributor

@puneetlath What I found as root cause for why your report is still being shown is because in the code block below shouldOverrideHidden is true because isExpenseReportWithoutParentAccess is true which comes from your report object's hasParentAccess being false (see diff below):

const shouldOverrideHidden =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || isExpenseReportWithoutParentAccess;
if (isHidden && !shouldOverrideHidden) {
return;
}

I confirmed this using Onyx.set locally as instructed, your report object (red) vs mine (green, which doesn't show up in LHN) here's the differences:

DIFF
{
  "chatReportID": "7874291990759816",
  "chatType": "",
  "currency": "USD",
  "description": "",
  "errorFields": {},
  "hasOutstandingChildRequest": false,
  "hasOutstandingChildTask": false,
- "hasParentAccess": false,
+ "hasParentAccess": true,
  "isCancelledIOU": false,
  "isOwnPolicyExpenseChat": false,
  "isPinned": false,
  "isWaitingOnBankAccount": false,
  "lastActionType": "IOU",
  "lastActorAccountID": "17364253",
- "lastMessageHtml": "$14.82 expense",
+ "lastMessageHtml": "paid $3.00 elsewhere",
- "lastMessageText": "$14.82 expense",
+ "lastMessageText": "paid $3.00 elsewhere",
  "lastReadSequenceNumber": 0,
- "lastVisibleActionCreated": "2024-11-11 22:01:02.083",
+ "lastVisibleActionCreated": "2024-11-13 23:33:10.631",
- "lastVisibleActionLastModified": "2024-11-11 22:01:02.083",
+ "lastVisibleActionLastModified": "2024-11-13 23:33:10.631",
  "managerID": 17364253,
- "nonReimbursableTotal": -7335,
+ "nonReimbursableTotal": 0,
  "notificationPreference": "hidden",
  "oldPolicyName": "",
  "ownerAccountID": 17364253,
  "parentReportActionID": "5395595152947009671",
  "parentReportID": "7874291990759816",
  "participants": {
    "17364253": {
      "hidden": true,
      "notificationPreference": "hidden"
    },
    "8033800": {
      "hidden": true,
      "notificationPreference": "hidden"
    },
    "9645353": {
      "hidden": true,
      "notificationPreference": "hidden"
    },
    "9662119": {
      "hidden": true,
      "notificationPreference": "hidden"
    },
    "9713816": {
      "hidden": true,
      "notificationPreference": "hidden"
    },
    "10903701": {
      "hidden": true,
      "notificationPreference": "hidden"
    }
  },
- "permissions": ["read", "write"],
+ "permissions": [],
  "policyID": "3B4762A4CCFD7388",
  "private_isArchived": "",
  "reportID": "3492368652977899",
- "reportName": "[Expensify Canada Inc] Justin's Expenses 2023-08-09 #R000V1AkK1m3",
+ "reportName": "Expense Report #3492368652977899",
- "statusNum": 3,
+ "statusNum": 4,
- "total": -7335,
+ "total": -300,
  "type": "expense",
- "unheldNonReimbursableTotal": -7335,
+ "unheldNonReimbursableTotal": 0,
- "unheldTotal": -7335,
+ "unheldTotal": -300,
  "welcomeMessage": "",
  "writeCapability": "all",
+ "lastReadTime": "2024-11-14 00:10:55.482"
}

When it comes to a solution, I don't have the context behind hasParentAccess and all its implications therefore I cannot be certain of the way to go here - but since we have the shouldOverrideHidden logic which includes the isExpenseReportWithoutParentAccess check, I'm assuming there must be a reason for it.

@puneetlath
Copy link
Contributor

Got it! I had a feeling it might be something to do with that.

That logic should only show the report in the LHN if the report has an RBR or GBR. Otherwise, it should remain hidden. Can you adjust it accordingly?

@ikevin127
Copy link
Contributor

@puneetlath You're saying that from this check:

const shouldOverrideHidden =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || isExpenseReportWithoutParentAccess;

  1. We should only remove isExpenseReportWithoutParentAccess and keep all other checks ?
  2. If yes to (1.), should I open a PR with the change ?
  3. If yes to (2.), given that I don't have access to your Expensify account for testing, for the Screenshots/Videos section of the PR Author Checklist should I demonstrate the fix using Onyx.set locally ?

@puneetlath
Copy link
Contributor

For 1, if we remove it from there will the expense report still show up in the LHN if it has a RBR/GBR? Because we do want it to show up in that scenario.

@puneetlath
Copy link
Contributor

If yes, then I'd say yes to both 2 and 3.

@ikevin127
Copy link
Contributor

For 1, if we remove it from there will the expense report still show up in the LHN if it has a RBR/GBR? Because we do want it to show up in that scenario.

@puneetlath Yes, expenses with RBR/GBR and other specific cases will still show up because all the other check conditions that are part of shouldOverrideHidden.

Before moing on with opening a PR, I did some digging into when isExpenseReportWithoutParentAccess was added to the condition and it was in commit 7db6f63 coming from PR #49557 where Details section says:

This is a follow-up to #48661, where I'm realizing we don't even care if the user is the report manager -> If the user doesn't have access to the expense report's parent report, we want to show this report in the LHN so the user always has access somehow

The part I put in bold is the key here because if I remove isExpenseReportWithoutParentAccess from the condition then we will revert that behaviour. Therefore, before moving forward I want to confirm with you whether we still care about that part that is is bold above (from the other PR) or we care more about this issue to have the reports hidden.

Please let me know!

@puneetlath
Copy link
Contributor

Thanks for double checking. Yes that's correct. We only care to show them if they have an RBR or GBR.

@ikevin127
Copy link
Contributor

ikevin127 commented Nov 14, 2024

Understood, will have a PR open in a few hours about 1 hour.

Edit: ✅ PR #52533 is open.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Nov 14, 2024
@melvin-bot melvin-bot bot changed the title Having the 'hidden' notification preference" the reports are displayed in LHN and not marked as read by the migration [HOLD for payment 2024-11-28] Having the 'hidden' notification preference" the reports are displayed in LHN and not marked as read by the migration Nov 21, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 21, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

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

Copy link

melvin-bot bot commented Nov 21, 2024

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

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

  • @ikevin127 requires payment (Needs manual offer from BZ)
  • @Puneet-here requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Nov 21, 2024

@ikevin127 @puneetlath / @alexpensify @ikevin127 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]

@ikevin127
Copy link
Contributor

@c3024 Was auto-assigned as C+ reviewer for this issue's PR and require payment.

@ikevin127
Copy link
Contributor

ikevin127 commented Nov 22, 2024

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
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 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: https://github.com/Expensify/App/pull/49557/files#r1854805374

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

Regression Test Proposal

  1. Create a new account.
  2. Create a new workspace and add one employee to it.
  3. As workspace Owner set your Settings > Preferences > Priority mode to #focus.
  4. As Employee - submit an expense report.
  5. As workspace Owner - Approve and pay the report.
  6. Verify that when clicking away from the opened LHN expense report, it will be hidden from LHN.

Do we agree 👍 or 👎.

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Nov 27, 2024
@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Nov 27, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-11-28] Having the 'hidden' notification preference" the reports are displayed in LHN and not marked as read by the migration [$250] [HOLD for payment 2024-11-28] Having the 'hidden' notification preference" the reports are displayed in LHN and not marked as read by the migration Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 27, 2024
Copy link

melvin-bot bot commented Nov 27, 2024

Current assignees @ikevin127 and @c3024 are eligible for the External assigner, not assigning anyone new.

@alexpensify
Copy link
Contributor

alexpensify commented Nov 27, 2024

Payouts due: 2024-11-28

Upwork job is here. Please accept the offers in Upwork, and I can complete the required process on the payment date. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2024
@ikevin127
Copy link
Contributor

Offer accepted, thanks!

@ikevin127
Copy link
Contributor

cc @alexpensify for visibility

@alexpensify
Copy link
Contributor

My apology; I should have clarified that I'm OOO this week, and yesterday was a US holiday. I have completed the payment process here today in Upwork. Closing!

@github-project-automation github-project-automation bot moved this from First Cohort - CRITICAL to Done in [#whatsnext] #migrate Nov 29, 2024
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 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Development

No branches or pull requests

6 participants