[bugfix] fix emoji recaching operations (#3167)

* add test for emoji update image

* update emoji recache to set the instance account id

* don't refresh emoji if only not cached. in that case literally just recache

* code comment

* rename + move a few things

* add some more code comments, and rename some functions to make logic a bit clearer

* remove unnecessary nil check (the value can be nil)

* comment wording

* remove test data output

* handle the case of caching an emoji which has been refreshed then uncached

* allow overwriting on testrig storage as we do now on regular storage

* fix emoji category ID not getting updated

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
kim 2024-08-03 17:05:38 +00:00 committed by GitHub
commit b85a9983d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 305 additions and 91 deletions

View file

@ -246,11 +246,9 @@ func (p *Processor) getEmojiContent(
// Ensure that stored emoji is cached.
// (this handles local emoji / recaches).
emoji, err = p.federator.RefreshEmoji(
emoji, err = p.federator.RecacheEmoji(
ctx,
emoji,
media.AdditionalEmojiInfo{},
false,
)
if err != nil {
err := gtserror.Newf("error recaching emoji: %w", err)