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-12-17] [HOLD for payment 2024-12-16] [$250] [Performance] Use initializer callbacks for useState #53322

Closed
6 tasks done
rezkiy37 opened this issue Nov 29, 2024 · 15 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@rezkiy37
Copy link
Contributor

rezkiy37 commented Nov 29, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


What performance issue do we need to solve?

e.g. memory consumption, storage read/write times, React native bridge concerns, inefficient React component rendering, etc.

Inefficient React component re-rendering and useState usage.

What is the impact of this on end-users?

List specific user experiences that will be improved by solving this problem e.g. app boot time, time to for some interaction to complete, etc.

This optimization reduces the render time.

List any benchmarks that show the severity of the issue

Please also provide exact steps taken to collect metrics above if any so we can independently verify the results.

Proposed solution (if any)

Please list out the steps you think we should take to solve this issue.

Pass an initializer callback to the useState hook instead of immediately calling functions. This ensures the callback is only executed once during the initial render. There is an issue (#53162) that they only fixed for BottomTabBar (https://github.com/callstack-internal/expensify-issues/issues/165).

As a part of the improvement, we need to integrate an Eslint rule (Expensify/eslint-config-expensify#138) to confirm if we will do it properly.

List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)

Note: These should be the same as the benchmarks collected before any changes.

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

Version Number: 9.0.68-3
Reproducible in staging?: yes
Reproducible in production?: yes
Email or phone of affected tester (no customers): N/A
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL: N/A
Issue reported by: @rezkiy37
Slack conversation: N/A

View all open jobs on Upwork

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863577701857268791
  • Upwork Job ID: 1863577701857268791
  • Last Price Increase: 2024-12-02
Issue OwnerCurrent Issue Owner: @CortneyOfstad
@rezkiy37
Copy link
Contributor Author

rezkiy37 commented Dec 2, 2024

Hi, I am Michael (Mykhailo) from Callstack, an expert agency and I can work on this issue.

*I forgot to post it 🙂

@mountiny mountiny added Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor labels Dec 2, 2024
@melvin-bot melvin-bot bot changed the title [Performance] Use initializer callbacks for useState [$250] [Performance] Use initializer callbacks for useState Dec 2, 2024
Copy link

melvin-bot bot commented Dec 2, 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 Dec 2, 2024

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

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

melvin-bot bot commented Dec 2, 2024

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

@mountiny mountiny removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 2, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 2, 2024
@rezkiy37
Copy link
Contributor Author

rezkiy37 commented Dec 4, 2024

I am preparing one more PR (#53568).

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 5, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Performance] Use initializer callbacks for useState [HOLD for payment 2024-12-16] [$250] [Performance] Use initializer callbacks for useState Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 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 Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.72-1 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-12-16. 🎊

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

  • @rezkiy37 does not require payment (Contractor)
  • @alitoshmatov requires payment through NewDot Manual Requests
  • @rezkiy37 does not require payment (Contractor)

Copy link

melvin-bot bot commented Dec 9, 2024

@alitoshmatov @CortneyOfstad @alitoshmatov The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@CortneyOfstad
Copy link
Contributor

@alitoshmatov can you complete the checklist when you have a moment? No rush as we have some time before Dec. 16 👍

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Dec 10, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-12-16] [$250] [Performance] Use initializer callbacks for useState [HOLD for payment 2024-12-17] [HOLD for payment 2024-12-16] [$250] [Performance] Use initializer callbacks for useState Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.73-8 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-12-17. 🎊

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

  • @rezkiy37 does not require payment (Contractor)
  • @alitoshmatov requires payment through NewDot Manual Requests
  • @rezkiy37 does not require payment (Contractor)

Copy link

melvin-bot bot commented Dec 10, 2024

@alitoshmatov @CortneyOfstad @alitoshmatov The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 16, 2024
@alitoshmatov
Copy link
Contributor

alitoshmatov commented Dec 16, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other: Performance improvement

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other: Not a bug, performance improvement

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: No offending PR, general clean up to enforce new eslint rule

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: No discussion

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

No regression test

Copy link

melvin-bot bot commented Dec 17, 2024

Payment Summary

Upwork Job

  • Contributor: @rezkiy37 is from an agency-contributor and not due payment
  • Reviewer: @alitoshmatov owed $250 via NewDot

BugZero Checklist (@CortneyOfstad)

  • 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/1863577701857268791/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@CortneyOfstad
Copy link
Contributor

Payment Summary

@alitoshmatov — to be paid $250 via NewDot
@rezkiy37 — contracted position

Regression Test

Checklist indicated no test needed here

@JmillsExpensify
Copy link

$250 approved for @alitoshmatov

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
Development

No branches or pull requests

5 participants