No way to re-fetch expired avatars.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Friends |
Fix Released
|
High
|
Robert Bruce Park |
Bug Description
So, this is a bug that I've suspected for a long time but wasn't able to confirm until I started seeing missing avatars in the qml frontend.
What's happening is that friends caches avatar URLs as new messages are published, and then some weeks later deletes the cached avatar images, but because we only store the cached URI rather than the original URL, we have no way to retrieve expired avatars that are still necessary. Essentially, if you're browsing through your stream, and you see a message that is older than ~3 weeks, and that particular person has not made any new messages since 3 weeks ago, then their avatar is lost from the cache, and we have no way of repopulating the cache because the original avatar URL is lost.
There are two possible solutions to this:
1. Stop deleting avatars from the cache entirely. We would need to add some new logic that redownloads old-ish cached avatars occaisionally, but at no point would we ever delete an avatar, leaving the frontends broken without avatars.
2. stop storing the cached avatar URI in the deemodel, but instead store the original public avatar URL instead, and then provide a public API method to fetch the cached avatar URI for our frontends to use. This would give us the information we need to actually be able to redownload avatars in the event of a cache miss after the expiry logic has deleted an avatar that we need.
Option 2 is how old Gwibber used to do it, but then I introduced the current behavior in the name of simplification without realizing the bug I was introducing.
Any thoughts, Ken?
Related branches
- Ken VanDine: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
- Robert Bruce Park: Approve
-
Diff: 84 lines (+16/-7)3 files modifieddebian/changelog (+8/-2)
friends/service/dispatcher.py (+4/-1)
friends/utils/avatar.py (+4/-4)
Changed in friends: | |
status: | Fix Committed → Fix Released |
I think I prefer option 2.