Avatar display error bug


#1

This seems to be a bug
Avatar quote post fail


(Mittineague) #6

I have noticed this recently on my localhost install, but I figured it was a VM on Windows thing and didn’t look into it.

<aside class="quote" data-post="9" data-topic="81"><div class="title" style="cursor: pointer;">
<div class="quote-controls"><i class="fa fa-chevron-down" title="expand/collapse"></i>
<a href="/t/table-plugin-test/81/9" title="go to the quoted post" class="back"></a>
</div>
<img width="20" height="20" src="//localhost:4000/letter_avatar/goodguy1/40/3.png" class="avatar">goodguy1:</div>
<blockquote><p>Let me try this</p></blockquote></aside> 

Hmmm, the double slash doesn’t look right
//localhost:4000


(cpradio) #7

No, double slash is very much intentional, it permits it to be protocol agnostic. So it works on HTTP or HTTPS


#8

Load picture wrong?


(Marcin Rataj) #9

I noticed something related:
I have an external JS app that fetches /latest.json from my Discourse and displays a list of topics with avatars.

Recently, Discourse added image_magick_version hash to the URL for default Letter Avatars:

/letter_avatar/<user>/25/3_af0dc75e546be11ab6c09c8b9d61c787.png

This broke letter avatars in my 3rd party app because /latest.json still returns letter_avatar URL without hash:

/letter_avatar/<user>/25/3.png

And this causes an empty dot to be returned instead of actual avatar:

I don’t understand the logic fully to provide a PR with a fix,
but perhaps someone else could take a look?


(TechnoBear) #10

It seems to be happening here with linked topics:

Screenshot where I first noticed it:

Link to that topic:
https://meta.discourse.org/t/top-row-now-shown-after-topic-opened/27565?source_topic_id=27540

Linking to a post, rather than the topic, doesn’t seem to produce the error.


(Jeff Atwood) #11

OK so the bug might be oneboxing a topic. If you can repro via the above steps (thanks @technobear), can you have a peek @eviltrout?


#12
https://d11a6trkgmumsb.cloudfront.net/assets/select2.png

Post new topics will be 404 error

//discourse-meta.s3-us-west-1.amazonaws.com/optimized/3X/7/6/76efed0dcdb4f0f36bc4d2f28e81a8e555954037_1_690x189.JPG


(Sam Saffron) #13

I was pretty sure @awesomerobot cleaned a lot of these up, maybe select2.png is still hanging out somewhere.


(Sam Saffron) #14

I think we need a global rebake, I may queue one. At least a rebake of all posts with images.


(Jeff Atwood) #15

Yes please we need to rebake all posts.


(TechnoBear) #16

The issue also seems to occur linking to a post on another site (e.g. linking to meta from SitePoint, or vice versa).

Exhibit A:


(Jeff Atwood) #17

Yep hopefully @eviltrout can fix this next week.


(Robin Ward) #18

I’ve pushed a fix for this. I need @zogstrip to review but it is working locally:

https://github.com/discourse/discourse/commit/03943554c6f8ece7f2b07d9aa34131ad1954e544


(Sam Saffron) #19

Sorry had to revert that.

The version for letter avatars was changed to a hash of the image magic version + fonts installed as a prefix.

This ensures that if we upgrade image magick at any time in the future we invalidate all old avatars. We can not use a simple number there. If anything anywhere is generating letter avatars incorrectly we need to fix that.


Discourse update has broken avatar URLs for WordPress integration
(Robin Ward) #20

But reverted it’s more broken than my fix was. I agree with adding the hash in, but right now there are missing avatars everywhere.


(Sam Saffron) #21

fixed per:

https://github.com/discourse/discourse/commit/296add56e663b233fef15f1b3cb9d4d09f8f6715


(Marcin Rataj) #22

Will it fix "avatar_template":"/letter_avatar/(..) URLs in https://meta.discourse.org/latest.json?
(I guess meta is still runing a version without the fix?)


(Adam Capriola) #23

Did the templates get changed again with the release of 1.3.0.beta7? Within the past day we’ve started seeing blanks from letter avatar templates that were saved externally to a SSO site I’m working on.


(Sam Saffron) #24

I had to change the template to codify the image magic version into it.