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

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

Closed
1 of 6 tasks
kbecciv opened this issue Jul 26, 2023 · 23 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 26, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jul 26, 2023

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)

@Pujan92
Copy link
Contributor

Pujan92 commented Jul 26, 2023

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.

@rezkiy37
Copy link
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.

@amyevans
Copy link
Contributor

Self-assigning since this is a regression from #21456

@laurenreidexpensify
Copy link
Contributor

@amyevans can we remove needs reproduction label then, as am assuming you can repro?

@amyevans amyevans removed the Needs Reproduction Reproducible steps needed label Jul 28, 2023
@amyevans
Copy link
Contributor

Good call, done!

@ayazhussain79
Copy link
Contributor

@amyevans can you please check that I have reported this #23647 bug before this #23638 one
@Pujan92 mentioned they have same RCA

@ayazhussain79
Copy link
Contributor

@amyevans @rezkiy37 please check that here is the root case of this issue #23647 that i have reported before PR deployed on staging and i have reported before this bug #23638

@rezkiy37
Copy link
Contributor

@amyevans @rezkiy37 please check that here is the root case of this issue #23647 that i have reported before PR deployed on staging and i have reported before this bug #23638

The root case is same. I fixed it here - #23815.

@ayazhussain79
Copy link
Contributor

ayazhussain79 commented Jul 31, 2023

@rezkiy37 yes it's fixed but i have reported this bug #23647 before this one #23638 you can check that on slack

@rezkiy37
Copy link
Contributor

@rezkiy37 yes it's fixed but i have reported this bug #23647 before this one #23638

Sorry, but I am a person who process such kind of questions. I am not an Expensify employee, I work at Callstack.

@ayazhussain79
Copy link
Contributor

@amyevans @laurenreidexpensify can you please that again #23638 (comment)

@amyevans amyevans changed the title Dev: Web - Console error on create new workspace [HOLD for payment 2023-08-08] Dev: Web - Console error on create new workspace Aug 7, 2023
@amyevans amyevans added Reviewing Has a PR in review Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Aug 7, 2023
@laurenreidexpensify laurenreidexpensify added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed Weekly KSv2 labels Aug 8, 2023
@melvin-bot melvin-bot bot 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 Aug 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

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

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

melvin-bot bot commented Aug 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

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

@laurenreidexpensify laurenreidexpensify removed 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 labels Aug 8, 2023
@laurenreidexpensify
Copy link
Contributor

Payment Preparation Summary:

@gadhiyamanan
Copy link
Contributor

@laurenreidexpensify offer accepted, thanks

@ayazhussain79
Copy link
Contributor

@laurenreidexpensify offer accepted, Thank you

@mananjadhav
Copy link
Collaborator

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

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

@laurenreidexpensify
Copy link
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
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

9 participants