Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !5759

Merged
Created Dec 04, 2013 by Administrator@rootOwner

Add cache expiry on avatar creation/removal

  • Overview 12
  • Commits 1
  • Changes 4

Created by: dblessing

This PR resolves #5496. If you add/remove an avatar the events cache is not updated and results in either a broken image or shows a gravatar instead of the avatar - see screenshots below. By adding a cache "expire/update" on both avatar creation/removal we can eliminate this issue. I took the approach of updating events by author id only and set it to limit to 1000 items. I'm not sure if this is the right limit or if a limit is warranted, but a similar cache reset for projects limits to 100 items. 100 seemed too low in this case because we have to expect that this user will have many events across multiple projects.

Steps to test (Please note that you cannot test this fix in a development environment without enabling caching)

  1. Add an avatar
  2. Go to the dashboard and note that the avatars on events are either still showing the gravatar or are showing a broken image link
  3. Apply this fix
  4. Change the avatar
  5. Go to the dashboard and note that the avatars are now showing the new image. Similarly, you can remove the avatar and note that gravatars are now shown on all events.

Illustration of the issue when an avatar is uploaded. You still see the gravatar/default avatar image: avatar_caching_issue

Illustration of the issue when a user already had an avatar and then changed it: avatar_caching_change

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/dblessing/issue-5496