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

[$250] Task – App crashes when click on assignee in existing task #49514

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 20, 2024 · 35 comments
Closed
2 of 6 tasks

[$250] Task – App crashes when click on assignee in existing task #49514

IuliiaHerets opened this issue Sep 20, 2024 · 35 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 20, 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: v9.0.39-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: https://expensify.testrail.io/index.php?/tests/view/4989792
Email or phone of affected tester (no customers): applausetester+jpcategory_2@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in
  3. Open any chat
  4. Create a task without assignee
  5. Open task details and click on assignee

Expected Result:

Assignee list opens

Actual Result:

App crashes

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

2009.txt

Bug6609721_1726820372331.Assignee_crash.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838194512143553982
  • Upwork Job ID: 1838194512143553982
  • Last Price Increase: 2024-09-23
  • Automatic offers:
    • jjcoffee | Reviewer | 104086587
    • nkdengineer | Contributor | 104086588
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

Triggered auto assignment to @alexpensify (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 Sep 20, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 20, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 20, 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.

@huult
Copy link
Contributor

huult commented Sep 20, 2024

Proposal

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

App crashes when click on assignee in existing task

What is the root cause of that problem?

Use 'report' before initialization

if (report && !ReportUtils.isTaskReport(report)) {

Screenshot 2024-09-20 at 16 00 15

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

Delay using the report until the report is complete.

// .src/pages/tasks/TaskAssigneeSelectorModal.tsx#L127
    const report: OnyxEntry<Report> = useMemo(() => {
        if (!route.params?.reportID) {
            return;
        }

+        InteractionManager.runAfterInteractions(() => {
+            requestAnimationFrame(() => {
                if (report && !ReportUtils.isTaskReport(report)) {
                    Navigation.isNavigationReady().then(() => {
                        Navigation.dismissModal(report.reportID);
                    });
                }
+            });
+        });

        return reports?.[`${ONYXKEYS.COLLECTION.REPORT}${route.params?.reportID}`];
    }, [reports, route]);
POC
Screen.Recording.2024-09-20.at.16.04.35.mp4

@nkdengineer
Copy link
Contributor

Proposal

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

App crashes

What is the root cause of that problem?

The report is used before it's initialize

const report: OnyxEntry<Report> = useMemo(() => {
if (!route.params?.reportID) {
return;
}
if (report && !ReportUtils.isTaskReport(report)) {
Navigation.isNavigationReady().then(() => {
Navigation.dismissModal(report.reportID);

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

Update this to get the report data from reports to check it's task report or not

const report: OnyxEntry<Report> = useMemo(() => {
    if (!route.params?.reportID) {
        return;
    }
    const reportOnyx = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${route.params?.reportID}`];
    if (reportOnyx && !ReportUtils.isTaskReport(reportOnyx)) {
        Navigation.isNavigationReady().then(() => {
            Navigation.dismissModal(reportOnyx.reportID);
        });
    }
    return reports?.[`${ONYXKEYS.COLLECTION.REPORT}${route.params?.reportID}`];
}, [reports, route]);

What alternative solutions did you explore? (Optional)

Or we can move the navigate logic to another useEffect

const report: OnyxEntry<Report> = useMemo(() => {
    if (!route.params?.reportID) {
        return;
    }
    return reports?.[`${ONYXKEYS.COLLECTION.REPORT}${route.params?.reportID}`];
}, [reports, route]);

useEffect(() => {
    if (report && !ReportUtils.isTaskReport(report)) {
        Navigation.isNavigationReady().then(() => {
            Navigation.dismissModal(report.reportID);
        });
    }
}, [report]);

@flodnv
Copy link
Contributor

flodnv commented Sep 20, 2024

Why did this just start happening upon this deploy? What PR caused this?

@nkdengineer
Copy link
Contributor

@flodnv Maybe it is caused by #48325. I tried to revert to the latest commit in production and install node-module again and the bug didn't happen. The bug started happening when I reverted to the first different between production and staging and re-install node-module again.

Screenshot 2024-09-20 at 17 57 53 Screenshot 2024-09-20 at 17 58 13

@grgia
Copy link
Contributor

grgia commented Sep 20, 2024

@grgia
Copy link
Contributor

grgia commented Sep 20, 2024

Updated #49241 cc @luacmartins

@rayane-djouah
Copy link
Contributor

Updated #49241 cc @luacmartins

This is not the offending PR. I tried reverting it locally, and I'm still able to reproduce the bug.

@melvin-bot melvin-bot bot added the Overdue label Sep 23, 2024
@flodnv
Copy link
Contributor

flodnv commented Sep 23, 2024

@flodnv Maybe it is caused by #48325. I tried to revert to the latest commit in production and install node-module again and the bug didn't happen. The bug started happening when I reverted to the first different between production and staging and re-install node-module again.

Thanks @nkdengineer. @rojiphil @BrtqKr can you please check if #48325 caused this?

@melvin-bot melvin-bot bot removed the Overdue label Sep 23, 2024
@BrtqKr
Copy link
Contributor

BrtqKr commented Sep 23, 2024

@flodnv, I don't think this would be related. Seems like accessing report from task is making this work

    const report: OnyxEntry<Report> = useMemo(() => {
        if (!route.params?.reportID) {
            return;
        }
        if (task?.report && !ReportUtils.isTaskReport(task?.report)) {
            Navigation.isNavigationReady().then(() => {
                Navigation.dismissModal(task?.report?.reportID);
            });
        }
        return reports?.[`${ONYXKEYS.COLLECTION.REPORT}${route.params?.reportID}`];
    }, [reports, route]);

currently, the memo is accessing itself and it seems to be the reason, why this bug is occurring, but this is quite surprising because it's been working like this for a while somehow

    const report: OnyxEntry<Report> = useMemo(() => {
        if (!route.params?.reportID) {
            return;
        }
        if (report && !ReportUtils.isTaskReport(report)) {
            Navigation.isNavigationReady().then(() => {
                Navigation.dismissModal(report.reportID);
            });
        }
        return reports?.[`${ONYXKEYS.COLLECTION.REPORT}${route.params?.reportID}`];
    }, [reports, route]);

@flodnv
Copy link
Contributor

flodnv commented Sep 23, 2024

Right, it is strange. I assigned you @nkdengineer

@flodnv flodnv added the External Added to denote the issue can be worked on by a contributor label Sep 23, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

📣 @jjcoffee 🎉 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 Sep 23, 2024

📣 @nkdengineer 🎉 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 📖

@nkdengineer
Copy link
Contributor

Thanks, will raise the PR soon.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Sep 23, 2024
@nkdengineer
Copy link
Contributor

@jjcoffee The PR is here

cc @flodnv

@flodnv
Copy link
Contributor

flodnv commented Sep 23, 2024

Thanks!

@alexpensify
Copy link
Contributor

Awesome, now we wait for this one to go to Prouduction.

@isagoico
Copy link

Retest was a pass 🎉

Recording.2024-09-23.115241.mp4

Checking it off the list.

@jasperhuangg jasperhuangg removed the DeployBlockerCash This issue or pull request should block deployment label Sep 30, 2024
@alexpensify
Copy link
Contributor

Flagging that automation failed, and it was deployed to production on 09-24.

@alexpensify
Copy link
Contributor

Ugh, automation failed and the payment date should have been yesterday. I'll work on the payment process tomorrow.

@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 3, 2024

  • The PR that introduced the bug has been identified. Link to the PR: I wasn't able to identify an offending PR
  • 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: N/A
  • 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. Yes - if one doesn't already exist
  • 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.

Regression Test Proposal

  1. Open any chat
  2. Create a task without an assignee
  3. Open task details and click on assignee
  4. Verify that the assignee page appears

Do we agree 👍 or 👎

@luacmartins
Copy link
Contributor

I think this will be caught during regular regression tests, since we have many tests on tasks.

@alexpensify
Copy link
Contributor

alexpensify commented Oct 4, 2024

Payouts due: 10-01-2024

Upwork job is here.

@alexpensify
Copy link
Contributor

Closing - I believe that I sent the payment via Upwork, but something looks off in Upwork. Please reply if you didn't get the payment and I'll fund the new job I sent your way. I'll return later to complete the regression test.

@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 7, 2024

@alexpensify I didn't receive any payment, just the notification that the contract has ended and weirdly another about accepting an offer (I've accepted this).

@nkdengineer
Copy link
Contributor

@alexpensify Same for me, the job just closed without payment. I accepted the new 2nd offer though, it can be paid out there.

@alexpensify
Copy link
Contributor

Thanks for these updates! There is an issue an Upwork that is being investigated to address the payment process. I'm going to hold until there is a fix. Convo: https://expensify.slack.com/archives/C01GTK53T8Q/p1728319262830679

@alexpensify alexpensify reopened this Oct 8, 2024
@alexpensify
Copy link
Contributor

@jjcoffee and @nkdengineer, our team figured out the Upwork bug, and I tried to complete the payment via another payment path in Upwork. Their support team is working on a permanent fix for the bug. I'd really appreciate it if you could confirm today's payment sent successfully under the new contract. Thanks!

@nkdengineer
Copy link
Contributor

@alexpensify Yes it was sent for me 💯 Thanks!

@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 9, 2024

Me too, thank you!

@alexpensify
Copy link
Contributor

Awesome, thanks for hanging in there with me. This bug is a wild one on the Upwork side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests