superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.72k stars 318 forks source link

[feature] skip fetching remote custom emojis altogether #2009

Open mirabilos opened 1 year ago

mirabilos commented 1 year ago

Is your feature request related to a problem ?

timestamp="20/07/2023 23:38:27.096" func=dereferencing.(*deref).populateEmojis level=ERROR msg="couldn't get remote emoji verified@mstdn.social: store: given emoji size 12.7kiB greater than max allowed 1B"

Describe the solution you'd like.

If the maximum size is set to 1 then just skip attempting that.

Describe alternatives you've considered.

Accepting these log messages as they are.

Additional context.

No response

daenney commented 1 year ago

I don't think we should do this based on setting that value to 1. Then next up someone sets it to 5 which is still not enough to likely fetch it and we're here all over again. There's a whole range of values where it doesn't make sense because they're likely too small to work.

If someone wants to disable it, I could see us special casing 0, or having a binary config option for it. In either case, we could do that check in the existing processemoji https://github.com/superseriousbusiness/gotosocial/blob/f8f03120427d9d10e1b730a7626880809e983076/internal/media/processingemoji.go#L204-L216 or insert a check for that config value in https://github.com/superseriousbusiness/gotosocial/blob/f8f03120427d9d10e1b730a7626880809e983076/internal/federation/dereferencing/emoji.go#L33 so we can forego doing a bunch of work entirely.

mirabilos commented 1 year ago

Daenney dixit:

I don't think we should do this based on setting that value to 1 […]

If someone wants to disable it, I could see us special casing 0,

I was kinda treating 1 as my actually-working special case to disable it because I wasn’t sure whether using 0 actually worked. If GtS were to support explicit disabling by setting this to 0 (or a separate option, which may be overkill, unless it’s easier for the software that way), I’d also be happy.

Thanks, //mirabilos --

Why don't you use JavaScript? I also don't like enabling JavaScript in Because I use lynx as browser. +1 -- Octavio Alvarez, me and ⡍⠁⠗⠊⠕ (Mario Lang) on debian-devel