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

HIGH: [Reliability] Stop doing a full report load + Auth call for any thread reports returned by GetChats #39225

Closed
quinthar opened this issue Mar 29, 2024 · 7 comments
Assignees
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Task Weekly KSv2

Comments

@quinthar
Copy link
Contributor

quinthar commented Mar 29, 2024

Problem:

My app times out attempting ReconnectApp after loading 6000+ reports in 3 min, as discussed here.

One observation is that that we are returning many "thread reports" and then calling Auth once per report to load it so we can build the report action object.

Solution:

  • Investigate what these reports are and why they are getting returned.
  • Move the logic that is loading the reports into Auth as explained in this comment so that we aren't calling Auth thousands of times in a row.
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d88324b92cfff3d0
  • Upwork Job ID: 1775305647007121408
  • Last Price Increase: 2024-04-02
Copy link

melvin-bot bot commented Mar 29, 2024

Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext.

@marcaaron
Copy link
Contributor

Ok I see this get called once: https://github.com/Expensify/Web-Expensify/blob/fae68e50dd8e05bd948d194a7bf27b2da781eab2/lib/ReportAPI.php#L6762

And then a lot of report actions getting instantiated which trigger a full load of the report...

https://github.com/Expensify/Web-Expensify/blob/1e7d277cc54f26e554a7e3ea57bfc7f224a7b0d6/lib/ReportAPI.php#L6775

Explanation of that code:

If one of the reports returned has a parentReportAction (a.k.a. it is a thread) then we call:

ReportUtils::buildParentActionOnyxData()

Which does a full report load right here: https://github.com/Expensify/Web-Expensify/blob/1e7d277cc54f26e554a7e3ea57bfc7f224a7b0d6/lib/ReportUtils.php#L3489

Gonna add some logs because there are not many (and maybe I missed what the problem really is - but seems right)...

And also think of some way to stop this....

@marcaaron marcaaron added the Internal Requires API changes or must be handled by Expensify staff label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

Copy link

melvin-bot bot commented Apr 2, 2024

Triggered auto assignment to Contributor Plus for review of internal employee PR - @DylanDylann (Internal)

@marcaaron marcaaron changed the title HIGH: [Reliability] Fix dbarrett's 3-min ReconnectApp timeout HIGH: [Reliability] Stop doing a full report load + Auth call for any thread reports returned by GetChats Apr 2, 2024
@marcaaron
Copy link
Contributor

Left a P/S here on how to get started on this.

And also thinking that even with those changes (which would improve the performance) - we probably still need pagination since way too many reports are getting returned.

@melvin-bot melvin-bot bot added the Overdue label Apr 12, 2024
@marcaaron
Copy link
Contributor

Focusing on AddComment 1:1:1 changes this week. Will give this a look next week.

@melvin-bot melvin-bot bot removed the Overdue label Apr 18, 2024
@marcaaron
Copy link
Contributor

Chatted with @quinthar and we're gonna close this one for now. Probably this improvement can be rolled into whatever issue we create for making OpenApp 1:1:1 (or maybe we can roll all of those improvements into pagination).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Task Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

3 participants