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

[HOLD for payment 2024-03-13] [$125] Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null. #37445

Closed
6 tasks done
lanitochka17 opened this issue Feb 28, 2024 · 25 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 28, 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: 1.4.44-11
Reproducible in staging?: Y
Reproducible in production?: Y
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new workspace
  3. Do not go to workspace chat (very important)
  4. Go offline
  5. Go to FAB > Request money > Manual
  6. Enter amount > Next
  7. Select the new workspace in Step 1
  8. Click on the workspace under "To"
  9. Go to Settings

Expected Result:

Workspace room settings will not show Visibility row

Actual Result:

Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null.
This issue only occurs when the workspace room has not been visited

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6395926_1709140787566.20240228_234931.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0122cd4185dcaeff62
  • Upwork Job ID: 1763061326536376320
  • Last Price Increase: 2024-03-01
  • Automatic offers:
    • eh2077 | Reviewer | 0
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 28, 2024
Copy link

melvin-bot bot commented Feb 28, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp
CC @quinthar

@lanitochka17
Copy link
Author

@kadiealexander FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@apeyada
Copy link
Contributor

apeyada commented Feb 28, 2024

Proposal

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

Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null

What is the root cause of that problem?

This happens when report.visibility = null, meets this condition:

{report?.visibility !== undefined &&

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

update condition to !!report?.visibility &&

@allgandalf
Copy link
Contributor

Proposal

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

Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null

What is the root cause of that problem?

This happens because when we are offline the visibility is returned as null but we return false only when it is undefined.

{report?.visibility !== undefined &&

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

We need to update the condition to report?.visibility ?? false.

Note: !!report?.visibility doesn't give any fallback value and hence can cause regression

What alternative solutions did you explore? (Optional)

N/A

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Feb 29, 2024
Copy link

melvin-bot bot commented Feb 29, 2024

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

@melvin-bot melvin-bot bot changed the title Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null. [$500] Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null. Feb 29, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 29, 2024
Copy link

melvin-bot bot commented Feb 29, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)

@dragnoir
Copy link
Contributor

Proposal

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

Report settings shows Visibility as newRoomPage.visibilityOptions.null

What is the root cause of that problem?

This condition does not cover the value when it's null

{report?.visibility !== undefined &&

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

Let's keep the same "coding standards" to to ensure consistency and maintainability across the codebase.
as it's used here;

{linkedWorkspace !== null && (

we can then change to:

- {report?.visibility != undefined &&
+ {report?.visibility != null &&

This condition will be true if report?.visibility is anything other than null or undefined, effectively extending the original check to cover null values as well.

What alternative solutions did you explore? (Optional)

To ensure the report?.visibility is not undefined, not null, and contains one of the specified values ('restricted', 'private', 'public', 'public_announce'), we can refine the conditional check by using a combination of nullish coalescing and checking if the value exists within your defined object. This way, we're not only checking for the presence of a value but also validating that it's one of the acceptable options.

Here's a code snippet:

const visibilityOptions = {
  restricted: 'Workspace',
  private: 'Private',
  public: 'Public',
  public_announce: 'Public Announce',
};

// Ensuring report?.visibility is defined and matches one of the keys in visibilityOptions
if (report?.visibility && visibilityOptions.hasOwnProperty(report.visibility)) {

We have the list of possible values here:

App/src/languages/en.ts

Lines 1951 to 1956 in 5cfcf69

visibilityOptions: {
restricted: 'Workspace', // the translation for "restricted" visibility is actually workspace. This is so we can display restricted visibility rooms as "workspace" without having to change what's stored.
private: 'Private',
public: 'Public',
// eslint-disable-next-line @typescript-eslint/naming-convention
public_announce: 'Public Announce',

This approach uses the hasOwnProperty method to check if report.visibility is a key within the visibilityOptions object. This ensures that report.visibility holds an acceptable value. If report.visibility is undefined or null, or if it's a value not included in visibilityOptions, the condition will evaluate to false, and the component won't be rendered.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Feb 29, 2024

Proposal

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

  • Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null.

What is the root cause of that problem?

  • After calling API CreateWorkspace, the report.visibility is set to null. Then go offline, and open report setting page, in here, report.visibility is null, that leads to the bug.

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

  • It should be fixed from BE side by returning report.visibility: undefined rather than null

What alternative solutions did you explore? (Optional)

  • NA

@youssef-lr
Copy link
Contributor

Regression from here, @tienifr can you take care of this please? I think we should just change that to report?.visibility &&

@eh2077
Copy link
Contributor

eh2077 commented Mar 1, 2024

@youssef-lr Thanks for your comment. Yeah, I agree with you about the solution. But I think this issue exists before @tienifr 's recent change, see below video of version v1.4.43-20. In this case, should we count it as a regression of @tienifr 's PR?

0-RPReplay_Final1709253832.mp4

@youssef-lr
Copy link
Contributor

Yeah sorry didn't check the code changed, it was there before. I think this is a pretty straightforward change though. So adjusting price accordingly and assigning the first contributor who posted.

@youssef-lr youssef-lr changed the title [$500] Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null. [$125] Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null. Mar 1, 2024
Copy link

melvin-bot bot commented Mar 1, 2024

Upwork job price has been updated to $125

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 1, 2024
Copy link

melvin-bot bot commented Mar 1, 2024

📣 @eh2077 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Mar 1, 2024

📣 @apeyada You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@eh2077
Copy link
Contributor

eh2077 commented Mar 4, 2024

@apeyada Kindly let us know when we can expect a PR to be ready for review. Thank you!

@apeyada
Copy link
Contributor

apeyada commented Mar 4, 2024

PR will be ready today

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Mar 4, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Mar 4, 2024
Copy link

melvin-bot bot commented Mar 4, 2024

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

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 6, 2024
@melvin-bot melvin-bot bot changed the title [$125] Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null. [HOLD for payment 2024-03-13] [$125] Room - Workspace room settings shows Visibility row with newRoomPage.visibilityOptions.null. Mar 6, 2024
Copy link

melvin-bot bot commented Mar 6, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 6, 2024
Copy link

melvin-bot bot commented Mar 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.47-10 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-03-13. 🎊

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

Copy link

melvin-bot bot commented Mar 6, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@eh2077] The PR that introduced the bug has been identified. Link to the PR:
  • [@eh2077] 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:
  • [@eh2077] A discussion in #expensify-bugs 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:
  • [@eh2077] Determine if we should create a regression test for this bug.
  • [@eh2077] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@eh2077
Copy link
Contributor

eh2077 commented Mar 11, 2024

Checklist

  • The PR that introduced the bug has been identified.
  • 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/35321/files#r1519481605
  • A discussion in #expensify-bugs 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
  • Determine if we should create a regression test for this bug: I think we don't need to add a regression test for this bug. It was introduced during TS migration and the fix is straightfoward.

cc @kadiealexander

@kadiealexander kadiealexander added Daily KSv2 and removed Weekly KSv2 labels Mar 12, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Mar 13, 2024
@kadiealexander
Copy link
Contributor

kadiealexander commented Mar 13, 2024

Payouts due:

Upwork job is here.

@youssef-lr
Copy link
Contributor

@kadiealexander this was changed to $125

@kadiealexander
Copy link
Contributor

Whoops, typo! Updated.

@apeyada please let me know when you've accepted the contract I sent across.

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
Projects
No open projects
Status: CRITICAL
Development

No branches or pull requests

9 participants