Skip to content

[HOLD for payment 2023-09-18] [$500] Dev: console error if we open RHN page directly #26561

Closed

Description

@kavimuru

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:

  1. Try to open direct link of RHN(for eg, http://localhost:8082/settings)
  2. Observe the console error

Expected Result:

Should not occur console error
Actual Result:
Error Failed prop type: The prop isBlockedFromConciergeis marked as required inAttachmentPickerWithMenuItems, but its value is undefined. occurs

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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: DEV
Reproducible in staging?: dev
Reproducible in production?: dev
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

Screen.Recording.2023-08-26.at.00.20.43.mov

Expensify/Expensify Issue URL:
Issue reported by: @Pujan92
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692985306887049

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013c4503a94278a1ad
  • Upwork Job ID: 1699435322866675712
  • Last Price Increase: 2023-09-06
  • Automatic offers:
    • situchan | Reviewer | 26527992
    • Pujan92 | Contributor | 26527994
    • Pujan92 | Reporter | 26527998

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 2, 2023
  2. melvin-bot commented on Sep 2, 2023

    @melvin-bot

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

  3. melvin-bot commented on Sep 2, 2023

    @melvin-bot

    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
  4. kavimuru commented on Sep 2, 2023

    @kavimuru
    Author

    Proposal from @Pujan92

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

    Console error for isBlockedFromConcierge passed undefined but it’s required prop

    What is the root cause of that problem?

    In PR we added prop isBlockedFromConcierge required in AttachmentPickerWithMenuItems & ComposerWithSuggestions components. But from ReportActionCompose it gets passed undefined when we directly open the RHN screen.

    const isBlockedFromConcierge = useMemo(() => ReportUtils.chatIncludesConcierge(report) && User.isBlockedFromConcierge(blockedFromConcierge), [report, blockedFromConcierge]);

    Bcoz by the time the report gets loaded it has a default value {reportID: ‘0’}, so condition ReportUtils.chatIncludesConcierge(report) returns undefined, with that undefined && false returns undefined and issue persist.

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

    We need to update the condition to make sure it will return a boolean value instead of undefined.

    App/src/libs/ReportUtils.js

    Lines 809 to 811 in 57603a0

    function chatIncludesConcierge(report) {
    return report.participantAccountIDs && _.contains(report.participantAccountIDs, CONST.ACCOUNT_ID.CONCIERGE);
    }

    !_.isEmpty(report.participantAccountIDs)
    

    OR
    We can use double negate or Boolean constructor to make ReportUtils.chatIncludesConcierge a boolean value.

    const isBlockedFromConcierge = useMemo(() => ReportUtils.chatIncludesConcierge(report) && User.isBlockedFromConcierge(blockedFromConcierge), [report, blockedFromConcierge]);

  5. dukenv0307 commented on Sep 6, 2023

    @dukenv0307
    Contributor

    Proposal

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

    DEV: console error on ReportActionCompose

    What is the root cause of that problem?

    We calculate isBlockedFromConcierge here

    const isBlockedFromConcierge = useMemo(() => ReportUtils.chatIncludesConcierge(report) && User.isBlockedFromConcierge(blockedFromConcierge), [report, blockedFromConcierge]);

    In chatIncludesConcierge, before the data is loaded completely report.participantAccountIDs is undefined that makes this function return undefined and then isBlockedFromConcierge is undefined because undefined && boolean = undefined

    App/src/libs/ReportUtils.js

    Lines 809 to 811 in bb432aa

    function chatIncludesConcierge(report) {
    return report.participantAccountIDs && _.contains(report.participantAccountIDs, CONST.ACCOUNT_ID.CONCIERGE);
    }

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

    We should update chatIncludesConcierge function to make sure it always returns a boolean by getting participantAccountIDs or set it as an empty array

    function chatIncludesConcierge(report) {
        const participantAccountIDs = report.parentReportActionIDs || []
        return participantAccountIDs && _.contains(participantAccountIDs, CONST.ACCOUNT_ID.CONCIERGE);
    }
    

    App/src/libs/ReportUtils.js

    Lines 809 to 811 in bb432aa

    function chatIncludesConcierge(report) {
    return report.participantAccountIDs && _.contains(report.participantAccountIDs, CONST.ACCOUNT_ID.CONCIERGE);
    }

    What alternative solutions did you explore? (Optional)

    We can also set default isBlockedFromConcierge prop value in AttachmentPickerWithMenuItems and ComposerWithSuggestions

  6. situchan commented on Sep 6, 2023

    @situchan
    Contributor

    Just doing an expedited review as this is annoying. When refresh app every time, hard to see other console errors caused by test branch as this one shows always.

    @Pujan92's proposal looks good - !_.isEmpty(report.participantAccountIDs)

    @sonialiap as this is dev-only issue, I am going to pull up engineer directly - 🎀 👀 🎀 C+ reviewed

  7. melvin-bot commented on Sep 6, 2023

    @melvin-bot

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

  8. nkuoch commented on Sep 6, 2023

    @nkuoch
    Contributor

    @Pujan92 's proposal looks good, but seems like I can't assign them to the issue, maybe because they didn't post the proposal to this issue by themselves?

  9. situchan commented on Sep 6, 2023

    @situchan
    Contributor

    @Pujan92 's proposal looks good, but seems like I can't assign them to the issue, maybe because they didn't post the proposal to this issue by themselves?

    correct.

    @Pujan92 please comment with any word here so @nkuoch can assign.
    @nkuoch please assign me too 🙂

  10. 45 remaining items

  11. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    @nkuoch, @Pujan92, @sonialiap, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  12. sonialiap commented on Sep 26, 2023

    @sonialiap
    Contributor

    @Pujan92 The GH issue was created and became available after the pricing change so the fix and review are both $500

  13. Pujan92 commented on Sep 26, 2023

    @Pujan92
    Contributor

    Oh, ok @sonialiap. I thought all payments needs to be with old price. Thanks for clearing.

  14. melvin-bot commented on Sep 29, 2023

    @melvin-bot

    @nkuoch, @Pujan92, @sonialiap, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

  15. sonialiap commented on Oct 2, 2023

    @sonialiap
    Contributor

    I believe all payments have been processed, please reopen if I missed anything in the discussion

  16. Pujan92 commented on Oct 3, 2023

    @Pujan92
    Contributor

    I believe all payments have been processed, please reopen if I missed anything in the discussion

    @sonialiap payment is pending here, could you plz check.

  17. Pujan92 commented on Oct 5, 2023

    @Pujan92
    Contributor
  18. Pujan92 commented on Oct 13, 2023

    @Pujan92
    Contributor

    Bump @sonialiap for remaining payment

  19. sonialiap commented on Oct 31, 2023

    @sonialiap
    Contributor

    @Pujan92 my apologies! Payment completed!

  20. Pujan92 commented on Oct 31, 2023

    @Pujan92
    Contributor

    No issues, Thanks!

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 contributorNeeds ReproductionReproducible steps needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions