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

Pre-emptively fetch answer reaction state #1459

Merged
merged 3 commits into from
Dec 8, 2023
Merged

Conversation

raccube
Copy link
Contributor

@raccube raccube commented Nov 7, 2023

No description provided.

@raccube raccube force-pushed the fix/prefetch-reaction-state branch from 1654852 to f91d2f2 Compare November 7, 2023 21:54
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (4314010) 95.41% compared to head (8facb44) 95.47%.
Report is 50 commits behind head on main.

Files Patch % Lines
app/controllers/discover_controller.rb 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1459      +/-   ##
==========================================
+ Coverage   95.41%   95.47%   +0.06%     
==========================================
  Files         174      174              
  Lines        2702     2697       -5     
==========================================
- Hits         2578     2575       -3     
+ Misses        124      122       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@pixeldesu pixeldesu left a comment

Choose a reason for hiding this comment

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

We talked about this in private already, I'll leave the feedback here just so we don't forget about it.

I'm not a fan of this approach because comparing against a pre-fetched set of IDs makes it harder to make independent components out of specific features. It brings a performance improvement, but at the cost of maintainability.

I'm personally not sure how to solve this. If a different way of caching, or using something like

if a global containing a pre-cached set of IDs is available, prefer that over fetching data yourself

could allow for both cases.

@raccube
Copy link
Contributor Author

raccube commented Nov 26, 2023

@pixeldesu @nilsding I rewrote this using subqueries, so the additional lookup queries aren't required at all.

@pixeldesu pixeldesu self-requested a review November 27, 2023 21:06
@raccube raccube force-pushed the fix/prefetch-reaction-state branch from 1e63338 to 8facb44 Compare November 27, 2023 21:14
@raccube raccube merged commit 1151669 into main Dec 8, 2023
10 of 13 checks passed
@raccube raccube deleted the fix/prefetch-reaction-state branch December 8, 2023 21:59
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.

3 participants