Skip to content

[$1000] [HOLD for payment 2023-08-08] Dev: Web - Console error on create new workspace #23638

Closed

Description

@kbecciv

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. Click on FAB icon
  2. Create a new workspace and check the console

Expected Result:

Should not show any console error

Actual Result:

Console error appears (Invalid prop reports.report_5370990936798009.writeCapability of value daily supplied to ReportScreenWrapper, expected one of ["all","admins"].
)

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: Dev 1.3.45-8
Reproducible in staging?: no
Reproducible in production?: no
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-07-26.at.12.54.33.PM.mov

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01db31db71b4efd7d9
  • Upwork Job ID: 1688916131373895680
  • Last Price Increase: 2023-08-08

Activity

  1. added
    Daily
    Needs Reproduction
    Bug
    on Jul 26, 2023
  2. melvin-bot commented on Jul 26, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jul 26, 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. dukenv0307 commented on Jul 26, 2023

    @dukenv0307
    Contributor

    Proposal

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

    Web - Console error on create new workspace

    What is the root cause of that problem?

    We are missing writeCapability param when we call buildOptimisticChatReport here which makes CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY becomes writeCapability param and that is an invalid value for writeCapability and then console error appear

    App/src/libs/ReportUtils.js

    Lines 2001 to 2013 in 1fac96b

    function buildOptimisticWorkspaceChats(policyID, policyName) {
    const announceChatData = buildOptimisticChatReport(
    [currentUserAccountID],
    CONST.REPORT.WORKSPACE_CHAT_ROOMS.ANNOUNCE,
    CONST.REPORT.CHAT_TYPE.POLICY_ANNOUNCE,
    policyID,
    CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
    false,
    policyName,
    null,
    // #announce contains all policy members so notifying always should be opt-in only.
    CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY,

    Screenshot from 2023-07-26 19-53-46

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

    We should add writeCapability param as CONST.REPORT.WRITE_CAPABILITIES.ALL before this line

    ...
    CONST.REPORT.WRITE_CAPABILITIES.ALL,
    CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY,
    

    CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY,

    What alternative solutions did you explore? (Optional)

  5. Pujan92 commented on Jul 26, 2023

    @Pujan92
    Contributor

    Proposal

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

    Console error for new workspace, request money action & child report navigation

    What is the root cause of that problem?

    It is a regression from PR #21950 where we have added an extra param writeCapability for the function buildOptimisticChatReport but not passed from all required buildOptimisticChatReport called occurrences.

    https://github.com/Expensify/App/pull/21950/files#diff-65c096044d5f69b35bcdec14c99c4fda4580759df9b1a7c36650d58eea276f1dR1763

    App/src/libs/ReportUtils.js

    Lines 2002 to 2014 in 1fac96b

    const announceChatData = buildOptimisticChatReport(
    [currentUserAccountID],
    CONST.REPORT.WORKSPACE_CHAT_ROOMS.ANNOUNCE,
    CONST.REPORT.CHAT_TYPE.POLICY_ANNOUNCE,
    policyID,
    CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
    false,
    policyName,
    null,
    // #announce contains all policy members so notifying always should be opt-in only.
    CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY,
    );

    const thread = ReportUtils.buildOptimisticChatReport(
    participantAccountIDs,
    props.translate(ReportActionsUtils.isSentMoneyReportAction(props.action) ? 'iou.threadSentMoneyReportName' : 'iou.threadRequestReportName', {
    formattedAmount: ReportActionsUtils.getFormattedAmount(props.action),
    comment: props.action.originalMessage.comment,
    }),
    '',
    CONST.POLICY.OWNER_EMAIL_FAKE,
    CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
    false,
    '',
    undefined,
    CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
    props.action.reportActionID,
    props.requestReportID,
    );

    const newChat = ReportUtils.buildOptimisticChatReport(
    participantAccountIDs,
    lodashGet(parentReportAction, ['message', 0, 'text']),
    lodashGet(parentReport, 'chatType', ''),
    lodashGet(parentReport, 'policyID', CONST.POLICY.OWNER_EMAIL_FAKE),
    CONST.POLICY.OWNER_ACCOUNT_ID_FAKE,
    false,
    '',
    undefined,
    CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
    parentReportAction.reportActionID,
    parentReportID,
    );

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

    We need to pass writeCapability param with the correct value in all 3 places.

  6. rezkiy37 commented on Jul 28, 2023

    @rezkiy37
    Contributor

    Hi, I’m Michael (Mykhailo) from Callstack and I would like to work in this issue, because I am the author of the broken PR.

  7. amyevans commented on Jul 28, 2023

    @amyevans
    Contributor

    Self-assigning since this is a regression from #21456

  8. 19 remaining items

  9. added
    External
    on Aug 8, 2023
  10. changed the title [-][HOLD for payment 2023-08-08] Dev: Web - Console error on create new workspace[/-] [+][$1000] [HOLD for payment 2023-08-08] Dev: Web - Console error on create new workspace[/+] on Aug 8, 2023
  11. melvin-bot commented on Aug 8, 2023

    @melvin-bot
  12. added
    Help Wanted
    on Aug 8, 2023
  13. melvin-bot commented on Aug 8, 2023

    @melvin-bot

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

  14. melvin-bot commented on Aug 8, 2023

    @melvin-bot

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

  15. removed
    External
    Help Wanted
    on Aug 8, 2023
  16. laurenreidexpensify commented on Aug 8, 2023

    @laurenreidexpensify
    Contributor

    Payment Preparation Summary:

  17. gadhiyamanan commented on Aug 8, 2023

    @gadhiyamanan
    Contributor

    @laurenreidexpensify offer accepted, thanks

  18. ayazhussain79 commented on Aug 8, 2023

    @ayazhussain79
    Contributor

    @laurenreidexpensify offer accepted, Thank you

  19. mananjadhav commented on Aug 8, 2023

    @mananjadhav
    Collaborator

    @laurenreidexpensify there is no payment for me, this was a regression. Payment will be handled in the policy-admin issue.

  20. laurenreidexpensify commented on Aug 8, 2023

    @laurenreidexpensify
    Contributor

    Payment Summary:

  21. laurenreidexpensify commented on Aug 8, 2023

    @laurenreidexpensify
    Contributor

    Closing out as the regression testing will be handled in the original issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDaily

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions