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

Remove unneeded eager loading for user show page #16520

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

marcusmoore
Copy link
Collaborator

This PR removes some unneeded related model loading for the user show page.

Most of the tables on the user show page are loaded via the api so we don't need to pass through assets, assets.model, or userlog.item.

When attempting to view a user with a lot of previous activity, the $user->userlog->load('item') line could potentially end up causing a memory exhaustion exception.

Copy link

what-the-diff bot commented Mar 17, 2025

PR Summary

  • Improved Readability of User Model Relationships Loading

    • The changes add clarity to the way our software retrieves connected data. Instead of chaining commands, we now use an array-based approach. This enhances the tidiness and readability of our code, reducing the potential for confusion.
  • Enhanced Simplicity in Returning User Data

    • The return statement's structure has been simplified by using an easy-to-understand array. Instead of compacting user and userlog into a single package, the new approach includes just user and settings. It makes processing the returned data more streamlined, resulting in better overall software performance.

@snipe snipe merged commit 44db2dc into snipe:develop Mar 31, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants