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 2023-08-08] [Performance] Show cached onyx content right away #22644

Closed
6 tasks done
hannojg opened this issue Jul 11, 2023 · 21 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@hannojg
Copy link
Contributor

hannojg commented Jul 11, 2023

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?

We are trying to make Onyx more performant by default. Right now, onyx always starts in a loading state, then collects all the
requested keys and sets them to the component state. This is often times inefficient as all the data is already available in a cache which we can read synchronously.

For exact technical details see: Expensify/react-native-onyx#269

What is the impact of this on end-users?

  • Unnecessary loading states: We often start by default in a loading state, although we could show the content right away. Showing the content directly provides better UX
  • Performance impacts due to a lot of re-renders: Due to this architecture a component re-renders a lot until it reached its final loaded state. This comes with a performance cost creating janky transitions to screens.

List any benchmarks that show the severity of the issue

See: Expensify/react-native-onyx#269

Proposed solution (if any)

See: Expensify/react-native-onyx#269

Once we have the onyx changes in place we need to update onyx in the app and adjust a few screens to work correctly. Some screens are build with the assumption that we will always start in a loading state.
We will start by adjusting the ReportScreen. The following adjustments need to be made (as discussed here):

  • Defer the loading of new chat messages to the next batch, so it doesn’t block the initial rendering by changing a state variable on the report.
  • There was recently a firstRenderRef introduced, which delays the real rendering of the report screen after it has been mounted. We want to get rid of it to show the available content right away.

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

See: Expensify/react-native-onyx#269

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: x
Reproducible in staging?: yes
Reproducible in production?: yes
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
**Issue reported by: @hannojg **
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1688580518417739

@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

Triggered auto assignment to @iwiznia (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@hannojg hannojg changed the title [Performance] Show cached onyx content right awak [Performance] Show cached onyx content right away Jul 11, 2023
@iwiznia iwiznia assigned hannojg and unassigned iwiznia Jul 11, 2023
@iwiznia
Copy link
Contributor

iwiznia commented Jul 11, 2023

@hannojg I assume you want this assigned to you since you'll be working on it, right?

@hannojg
Copy link
Contributor Author

hannojg commented Jul 12, 2023

Yes, correct, thank you!

@hannojg
Copy link
Contributor Author

hannojg commented Jul 17, 2023

The PR is ready for review:

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

@hannojg Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Jul 20, 2023
@hannojg
Copy link
Contributor Author

hannojg commented Jul 24, 2023

This is on hold as the work and discussions are happening here:

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

@hannojg Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Jul 27, 2023
@hannojg
Copy link
Contributor Author

hannojg commented Jul 28, 2023

Hey @MelvinBot everyone is working eagerly on getting this merged!

We merged the PR in onyx and released version 1.0.56:

However, in Onyx version 1.0.55 a bug has been introduced which causes a crash on mobile native.
We are trying to fix that here:

Once that's done, we can get this merged:

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 1, 2023
@melvin-bot melvin-bot bot changed the title [Performance] Show cached onyx content right away [HOLD for payment 2023-08-08] [Performance] Show cached onyx content right away Aug 1, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@mountiny mountiny added the Bug Something is broken. Auto assigns a BugZero manager. label Aug 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 6, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 6, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@mountiny
Copy link
Contributor

mountiny commented Aug 6, 2023

We need to pay $1000 to @mollfpr for their review and testing

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Daily KSv2 and removed Daily KSv2 Weekly KSv2 labels Aug 7, 2023
@slafortune
Copy link
Contributor

@slafortune
Copy link
Contributor

Paid

@hannojg
Copy link
Contributor Author

hannojg commented Aug 14, 2023

The original PR for this issue was reverted and the new PR can be found here:

Can we reopen this issue please @slafortune ?e

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 17, 2023
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 Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants