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

Add following_tags_count to user sidebar stats cache key #11042

Merged
merged 2 commits into from Oct 26, 2020

Conversation

krzysiek1507
Copy link
Contributor

@krzysiek1507 krzysiek1507 commented Oct 23, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Adding following_tags_count gets rid of the issue when @user.last_followed_at doesn't change.
This line is quite long. Is there any "repo" for cache keys?

Related Tickets & Documents

Closes #5657

QA Instructions, Screenshots, Recordings

Play with (un)following tags and check if the counter on the user profile changes.

Added tests?

  • yes
  • no, because they aren't needed
  • no, because I need help

Added to documentation?

  • docs.forem.com
  • readme
  • no documentation needed

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 23, 2020
Copy link
Contributor

@mstruve mstruve left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! The code looks good. Offered a small suggestion to improve the readability of the cache key, feel free to add it if you would like.

app/views/users/_sidebar.html.erb Outdated Show resolved Hide resolved
@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 26, 2020
Co-authored-by: Molly Struve <mollylbs@gmail.com>
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 26, 2020
@krzysiek1507
Copy link
Contributor Author

Thanks @mstruve. I applied your suggestion!

@mstruve mstruve requested a review from rhymes October 26, 2020 15:22
Copy link
Contributor

@vaidehijoshi vaidehijoshi left a comment

Choose a reason for hiding this comment

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

This works beautifully -- thank you for taking the time to fix this, @krzysiek1507!! 💯

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 26, 2020
@mstruve mstruve merged commit 2187137 into forem:master Oct 26, 2020
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 26, 2020
@krzysiek1507 krzysiek1507 deleted the fix/5657-user-sidebar-stats branch October 26, 2020 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Following a tag should update user sidebar stats
3 participants