Falco
(Falco)
13 Septiembre, 2022 15:42
2
Sí, ese es el comportamiento que la implementación principal de Discourse ha tenido 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! 💪
He movido esta conversación a un nuevo tema y la he marcado como pr-welcome , para una configuración a nivel de plugin que desactive la actualización del autor. Alguien que quiera trabajar en esto probablemente necesitará agregar un nuevo parámetro a TopicEmbed.import y luego usarlo en el plugin.
4 Me gusta