Falco
(Falco)
Setembro 13, 2022, 3:42pm
2
Sim, esse é o comportamento que o núcleo do Discourse implementa desde 2018:
master ← xrav3nz:fix-topic-embed-import-should-update-user
opened 05:14AM - 19 Apr 18 UTC
We ran into a problem where `PollFeed` job didn't update the post author with th… e one found in the RSS feed.
Then I found out `TopicEmbed.import` only updates the post body and neglects new title or author, when a post with the same `embed_url` already exists.
---
Consider the scenario:
1. A blog page with Discourse embedded comment hits `embed_controller#comments`
2. The topic doesn't exist yet, so it tries to fetch the content from RSS feed, but it didn't because feed polling is rate limited
4. It then crawls the webpage and creates a topic with [the default `embed_by_username`](https://github.com/discourse/discourse/blob/ab80986184a498f68d99541c63558ea2089f49d3/lib/topic_retriever.rb#L48)
5. `PollFeed` is schedule to run at a later time, and it fetches the title, content, and author from the RSS feed with [`embed_username_key_from_feed`](https://github.com/discourse/discourse/blob/ab80986184a498f68d99541c63558ea2089f49d3/app/jobs/scheduled/poll_feed.rb#L156).
6. The post should be updated with the title, content and author from the feed.
---
Let me know what you think, cheers! 💪
Movi esta conversa para um novo tópico e estou tornando-a pr-welcome , para uma configuração em nível de plugin para desabilitar a atualização do autor. Alguém que queira trabalhar nisso provavelmente precisará adicionar um novo parâmetro a TopicEmbed.import e, em seguida, usá-lo no plugin.
4 curtidas