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-05-08] [$250] App Crashes When Exiting and Re-entering Thread in Offline #41130

Closed
4 of 6 tasks
m-natarajan opened this issue Apr 27, 2024 · 21 comments
Closed
4 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. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Apr 27, 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: v1.4.67-0
Reproducible in staging?: y
Reproducible in production?: n
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, sign in with your Gmail account> Navigate to any chat and set the status to offline.
2, Send a message and enter the thread.
3, Click on the three dots menu and select "Leave thread."
4, Re-enter the thread.
5, Switch status to online.

Expected Result:

App functions normally without crashing

Actual Result:

App crashes upon transitioning from offline to online after leaving and re-entering the thread.

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

Bug6463543_1714202185410.Screen_Recording_2024-04-26_at_11.46.00_PM.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cd50bce934ebc9f8
  • Upwork Job ID: 1784870016982994944
  • Last Price Increase: 2024-04-29
  • Automatic offers:
    • akinwale | Reviewer | 0
    • gijoe0295 | Contributor | 0
Issue OwnerCurrent Issue Owner: @CortneyOfstad
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 27, 2024
Copy link

melvin-bot bot commented Apr 27, 2024

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

Copy link

melvin-bot bot commented Apr 27, 2024

Triggered auto assignment to @arosiclair (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 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.

@m-natarajan
Copy link
Author

@arosiclair 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.

@m-natarajan
Copy link
Author

We think this bug might be related to #vip-vsb

@gijoe0295
Copy link
Contributor

Proposal

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

App crashes upon transitioning from offline to online after leaving and re-entering the thread.

What is the root cause of that problem?

Regression of #41087.

We fallback undefined avatar to {}:

result.icons = ReportUtils.getIcons(report, personalDetails, UserUtils.getAvatar(personalDetail?.avatar ?? {}, personalDetail?.accountID), '', -1, policy);

Later we do not include empty source object check to determine whether to use fallback avatar:

const useFallBackAvatar = imageError || source === Expensicons.FallbackAvatar || !source;

Then we used {} as a React component:

const ImageSvgComponent = src as React.FC<SvgProps>;

And thus got Element type is invalid: expected a string (for built-in components) or a class/function but got: object error.

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

Do not fallback to {}:

result.icons = ReportUtils.getIcons(report, personalDetails, UserUtils.getAvatar(personalDetail?.avatar ?? {}, personalDetail?.accountID), '', -1, policy);

What alternative solutions did you explore? (Optional)

Or add a check for empty source object to use fallback avatar:

const useFallBackAvatar = imageError || source === Expensicons.FallbackAvatar || !source;

@shubham1206agra
Copy link
Contributor

@gijoe0295 The PR you mentioned is prod but this is a deploy blocker.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Apr 29, 2024
@melvin-bot melvin-bot bot changed the title App Crashes When Exiting and Re-entering Thread in Offline [$250] App Crashes When Exiting and Re-entering Thread in Offline Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

@gijoe0295
Copy link
Contributor

Thanks @shubham1206agra. It actually turned out to be a problem with Onyx when casting null to {}. Let me investigate further.

@arosiclair
Copy link
Contributor

I reproduced on web v1.4.67-0

@arosiclair
Copy link
Contributor

arosiclair commented Apr 29, 2024

@gijoe0295 I think your proposal is on the right track. When report and defaultAvatar are empty objects in ReportUtils.getIcons, the fallbackIcon.source will be set to an empty object here which causes the crash.

Removing ?? {} for the defaultAvatar fixes the issue. However, I think it is probably better to just check for when defaultAvatar is an empty object to prevent this in the future. Can you submit a PR for this @gijoe0295?

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

melvin-bot bot commented Apr 29, 2024

📣 @akinwale 🎉 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 Apr 29, 2024

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@gijoe0295
Copy link
Contributor

Working on PR now.

@MonilBhavsar
Copy link
Contributor

Should be fixed by #41219

@thienlnam
Copy link
Contributor

Yup, appears to be resolved for me on staging now - thanks Monil!

@francoisl francoisl removed the DeployBlockerCash This issue or pull request should block deployment label Apr 29, 2024
@arosiclair
Copy link
Contributor

Alright sounds like this is no longer needed. Appreciate your efforts @gijoe0295 but you got beat to the punch.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Hourly KSv2 labels May 1, 2024
@melvin-bot melvin-bot bot changed the title [$250] App Crashes When Exiting and Re-entering Thread in Offline [HOLD for payment 2024-05-08] [$250] App Crashes When Exiting and Re-entering Thread in Offline May 1, 2024
Copy link

melvin-bot bot commented May 1, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.68-3 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-05-08. 🎊

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

Copy link

melvin-bot bot commented May 1, 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:

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

@gijoe0295
Copy link
Contributor

gijoe0295 commented May 3, 2024

Hi @CortneyOfstad, @arosiclair, I wonder if my compensation for this issue should be put into account because Help Wanted label was added, I provided a working solution, got assigned and considerable efforts had been made for investigation and implementation with urgency (within 2 hours after assignment). I know it's not an official guideline but I observed several places where contributors got paid even though PR might not be merged due to objective causes.

I would appreciate if we could discuss it. Please ignore and pardon me if my suggestion is not aligned with Expensify's contributing guidelines/practice.

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

No branches or pull requests

10 participants