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

fix: Repeated calls to group self #3321

Conversation

michael-genson
Copy link
Collaborator

@michael-genson michael-genson commented Mar 15, 2024

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

As shown in issue #3317, PR #3303 introduced a bug where each recipe makes a call to .../groups/self. This is especially apparent on the home page (as there are typically dozens of recipes that load immediately, all of which make the API call).

This PR implements a shared state similar to the one introduced in #3306. I also noticed that the group self call returns a ton of data which could be considered private (all user data is in the response body), not to mention simply unnecessary, so similar to #3305 I created a GroupSummary model that only returns basic info (id, name, slug, and preferences).

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #3317

Testing

(fill-in or delete this section)

Manually verified the self route is only called once per page, and manually verified none of the "unnecessary" data was being used.

Copy link
Collaborator

@boc-the-git boc-the-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@boc-the-git boc-the-git merged commit f1e8d63 into mealie-recipes:mealie-next Mar 20, 2024
10 checks passed
@michael-genson michael-genson deleted the fix/repeated-calls-to-groups-self branch March 20, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Mealie is repeatedly calling /api/groups/self on home page when scrolling
2 participants