FIX: add short_path to upload_serializer (PR #9417)

What problem I am trying to solve?

When an encrypted message is crafted and the image is added - discourse needs a hard refresh to display that image.

What is happening?

Everything starts here - when the upload is finished we add serialized object to the cache

Then, discourse-encrypt is trying to get an image from the cache and use short_path property

Why is it working after a hard refresh?

After refresh, we populate cache once again using that function:

And lookup_urls method from backend is returning short_path

TL;DR We should expose short path in upload serializer. I ensured that this serializer is used only when attachments are uploaded so it should not affect performance.


Nice detective work :mag: