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-07-10] [$250] A newly created workspace's room crashes on the details page. #44410

Closed
1 of 6 tasks
m-natarajan opened this issue Jun 25, 2024 · 26 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Jun 25, 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: 9.0.2-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: @jayeshmangwani
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1719335250993669

Action Performed:

  1. Create a new workspace and navigate to LHN.
  2. Press FAB -> Start chat -> # Room.
  3. Add a room name and select the newly created workspace.
  4. Press the "Create room" button.
  5. On the workspace room, press the header to navigate to the details page.

Expected Result:

Room Details page should be loaded

Actual Result:

Room Details page crashed

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

crash-on-room.mov

Snip - New Expensify - Google Chrome (2)

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c68edfdc6e18287a
  • Upwork Job ID: 1806385412672282404
  • Last Price Increase: 2024-06-27
Issue OwnerCurrent Issue Owner: @johncschuster
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Jun 26, 2024

Proposal

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

Create a new room and open the details page will crash the app.

What is the root cause of that problem?

As shown in the error log, the issue is the onyx key is changed from a collection key (report_) to a collection member key (report_-1).

const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID ?? '-1'}`);

Creating a new room will optimistically set the parentReportID to an empty string (the param before description).

const policyReport = ReportUtils.buildOptimisticChatReport(
participants,
values.roomName,
CONST.REPORT.CHAT_TYPE.POLICY_ROOM,
policyID,
CONST.REPORT.OWNER_ACCOUNT_ID_FAKE,
false,
'',
visibility,
writeCapability || CONST.REPORT.WRITE_CAPABILITIES.ALL,
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
'',
'',
parsedDescription,
);

App/src/libs/ReportUtils.ts

Lines 4580 to 4581 in 8f3e925

parentReportID = '',
description = '',

Because it's an empty string, the onyx key becomes report_. The add workspace room API will later return the parentReportID as null which is to clear it from the onyx, so now, the onyx key becomes report_-1.

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

We can optimistically set the parentReportID to null,

OR

Use || instead of ??.

const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID ?? '-1'}`);

OR

Pass the parentReportID as undefined and remove the empty string default value so it stays as undefined.

parentReportID = '',

@jayeshmangwani
Copy link
Contributor

@johncschuster This issue is happening on staging and not on production; it is a deploy blocker

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jun 27, 2024
@mountiny mountiny self-assigned this Jun 27, 2024
Copy link

melvin-bot bot commented Jun 27, 2024

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

@melvin-bot melvin-bot bot changed the title A newly created workspace's room crashes on the details page. [$250] A newly created workspace's room crashes on the details page. Jun 27, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 27, 2024
Copy link

melvin-bot bot commented Jun 27, 2024

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

@mountiny mountiny added DeployBlockerCash This issue or pull request should block deployment and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 27, 2024
Copy link

melvin-bot bot commented Jun 27, 2024

Current assignee @mountiny is eligible for the DeployBlockerCash assigner, not assigning anyone new.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jun 27, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Jun 27, 2024
@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Jun 27, 2024
@mountiny
Copy link
Contributor

We need to pay $50 to @bernhardoj for identifying the fix

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Jul 3, 2024
@melvin-bot melvin-bot bot changed the title [$250] A newly created workspace's room crashes on the details page. [HOLD for payment 2024-07-10] [$250] A newly created workspace's room crashes on the details page. Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 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 Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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

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

Copy link

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

  • [@mountiny] The PR that introduced the bug has been identified. Link to the PR:
  • [@mountiny] 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:
  • [@mountiny] 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:
  • [@mountiny] Determine if we should create a regression test for this bug.
  • [@mountiny] 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.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@johncschuster
Copy link
Contributor

johncschuster commented Jul 8, 2024

Payment Summary:

Bug Bounty: @bernhardoj - $50 - paid via Manual Request (see comment for identifying the fix in this issue)

@jayeshmangwani
Copy link
Contributor

Contributor: @jayeshmangwani - $250 - paid via Manual request (to be paid on/after July 10)

@johncschuster No payment for me here, as I haven't reviewed the PR

@mountiny
Copy link
Contributor

mountiny commented Jul 8, 2024

Correct, only @bernhardoj

@mallenexpensify
Copy link
Contributor

Desktop is crashing when I click the header. I'm assuming it's a different bug but wanted to check here first.

2024-07-08_17-44-51.mp4

Logs
logs-2024-07-09 00_46_30.733.txt

@johncschuster
Copy link
Contributor

johncschuster commented Jul 9, 2024

Thanks, @jayeshmangwani! I've updated the payment summary comment and will issue payment now since the fix proposal shouldn't be held on a deploy.

@bernhardoj
Copy link
Contributor

Requested in ND.

@johncschuster
Copy link
Contributor

Great! I've updated the comment above to reflect you will be paid via ND instead of Upwork. Thank you!

@JmillsExpensify
Copy link

$50 approved for @bernhardoj

@johncschuster
Copy link
Contributor

Today's the day to close this up assuming there hasn't been a regression. @mountiny, did you see @mallenexpensify's comment above? Could that be a regression introduced from the work here, or do you think that's from something else?

@mountiny
Copy link
Contributor

It's hard to say; the logs are not that helpful in case of a crash like this.

@mallenexpensify remember that anytime you get this crash, open the console and the reason for the crash will be written there, the logs shared are not the same.

I think we can proceed and the crash should be reported in bug channel showing the console too

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

Payment Summary

Upwork Job

BugZero Checklist (@johncschuster)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1806385412672282404/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@johncschuster
Copy link
Contributor

I think Melvin is wrong about @bernhardoj's contributions (They identified a fix. I don't think they reviewed any PRs - checking on that.)

@bernhardoj
Copy link
Contributor

Yes, I don't review any PR. The payment is also already approved.

@mallenexpensify
Copy link
Contributor

remember that anytime you get this crash, open the console and the reason for the crash will be written there, the logs shared are not the same.

Thanks @mountiny , I was uncertain about this, kinda assumed we'd share errors in the logs we'd be sharing. I'll update the BZ team tomorrow too when I do an EOW post.

@johncschuster
Copy link
Contributor

Thanks @bernhardoj and @mallenexpensify! Ok, it sounds like we can close this then. Please let me know if I'm wrong!

This issue was closed.
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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants