FIX: Get correct selectable avatar from URL (PR #10339)

The URL for selectable avatars was ‘cooked’ which means that the find_by method was not enough.

GitHub

This API feels really fragile, shouldn’t select url simply use “intention” here?

“select the letter avatar” “select the avatar I uploaded” “select the avatar from gravatar”

Feels really fragile to have the API use URLs here and we are just cascading fixes, I prefer to fix the root here and break the API endpoint which is weird anyway.

This API feels really fragile, shouldn’t select url simply use “intention” here?

That endpoint is only used when “selectable avatars” is enabled. Since we’re storing the selectable avatars using their URLs

The “change avatar” modal go through the /my/preferences/avatar/pick endpoint which is already sending the “intention”.

Do you mean we should merge both code paths?

Also, I think we should change the way “selectable avatars” work and use upload ids instead of URLs.

Doesn’t this feature then have upload ids it can work with? Seems way more stable

I don’t think we need to merge the two controllers but using ids should be better

1 Like

Yes, it’s in the pipeline. Might take some work since we don’t yet have controls for settings that supports a list of upload ids.

2 Likes