-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fixing eager loading issue in admin/moderation/reports #19274
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #19274 +/- ##
==========================================
- Coverage 88.86% 88.86% -0.01%
==========================================
Files 1177 1177
Lines 26433 26433
Branches 2028 2028
==========================================
- Hits 23491 23490 -1
- Misses 2789 2790 +1
Partials 153 153
Flags with carried forward coverage won't be shown. Click here to find out more. see 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Uffizzi Preview |
Any suggestions on how to QA this? I don't see bullet errors on |
I couldn't reproduce this error too, but checked the code: it's interesting that we do have refer to the
So, if we remove
So, we can't just remove the |
I could reproduce (on another computer) on a main branch with this data:
Interestingly, these records have |
@jaw6 I wasn't aware that it happened under certain scenarios only. I just had the fresh copy of the entire project and this error started. I think @lightalloy comments can help. @lightalloy Thanks for detailed investigation. |
I'm still having trouble replicating, despite having created many reports in my local environment. Still not sure what's up, but — just reading along — it does seem like we want this eager load more than we don't, @lightalloy is probably correct that this is a bullet bug. |
@jaw6 @lightalloy |
@@ -3,7 +3,7 @@ class FeedbackMessagesController < Admin::ApplicationController | |||
layout "admin" | |||
|
|||
def index | |||
@q = FeedbackMessage.includes(:reporter, :offender, :affected) | |||
@q = FeedbackMessage.includes(:offender, :affected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this in a comment previously, but I think the system wants me to formally request changes, so... I think instead we should add reporter
to the bullet configuration here as (another) unused_eager_loading
.
It should be fairly straight-forward, but let me know if you want to pair on it, sometimes nice to have an extra set of eyes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have applied this change. Thanks @jaw6 for clarification.
Bullet.add_safelist(type: :unused_eager_loading, class_name: "FeedbackMessage", association: :reporter)
Thanks @jaw6 Will apply these changes on Monday. |
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough context to provide any meaningful review here, so I'm tagging myself out from review on this (or hoping that this comment-review fulfills GitHub's request for my comment).
Hi @jaw6 Can you please review this PR now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me — though, I never experienced the bullet alert myself, so trusting that this does actually resolve the problem!
* Removed reports from eager loading * Fixed the issue in a bit different way
What type of PR is this? (check all applicable)
Description
If we open http://localhost:3000/admin/moderation/reports in locally, it fails to load the page with following error:
This PR fixes this error by removing
reporter
from eager loading.Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Error + Solution Video: https://www.loom.com/share/600d4b029f8c49babe98d805a82bf78e
UI accessibility concerns?
No
Added/updated tests?
[Forem core team only] How will this change be communicated?