引用文本中显示旧用户头像?

我不确定这究竟是一个 bug,还是仅仅是一种我不太理解的行为,但看起来在帖子中引用某人时,会保存引用时刻他们的头像。例如:

这似乎是以下问题的回归:
https://meta.discourse.org/t/after-changing-avatar-quotes-still-show-the-old-avatar/21122

Not a bug; it’s always been that way.

2 个赞

I suppose its because the posts are baked with the URL at the time. Do you want a fix for this, or is it too potentially resource intensive to trigger a rebake each time someone changes their avatar?

Changing the avatar already triggers a rebake of posts containing quotes, but it’s currently quite resource intensive to find and rebake all posts. So, it’s possible that some of them won’t be updated. Post revisions aren’t updated at all.

I have plans to fix all of this when I’m working on improvements for user renaming/anonymizing in one of the next releases. It will require a new table that keeps track of all the places where a user is quoted, mentioned, oneboxed, and what not.

If you want to work on this, please keep in mind that rebaking just to update the avatar isn’t needed. I’d suggest reusing code from UpdatUsername. It’s a lot faster.

8 个赞

这发生在 after_save 之后,但使用了 will_save_change,所以我很确定它从未真正触发。看起来以前是可以的,但 2017 年的这个提交(我猜是错误的)从 _changed 变成了 will_save_change

3 个赞

我认为这也有几个#bug话题:

4 个赞

感谢 @dsims 找到此问题的根本原因!我已创建了一个包含修复程序的 PR。

4 个赞

此主题已在 4 天后自动关闭。不再允许回复。